Record Class GeolocationOptions

java.lang.Object
java.lang.Record
com.vaadin.flow.component.geolocation.GeolocationOptions
Record Components:
enableHighAccuracy - whether to request high-accuracy position data (e.g. GPS), or null for the browser default (false)
timeout - the maximum time in milliseconds to wait for a position, or null for the browser default (Infinity)
maximumAge - the maximum age in milliseconds of a cached position that is acceptable, or null for the browser default (0)
All Implemented Interfaces:
Serializable

public record GeolocationOptions(Boolean enableHighAccuracy, Integer timeout, Integer maximumAge) extends Record implements Serializable
Options for the browser's Geolocation API.

All fields are optional. When null, the browser's default values are used.

See Also:
  • Constructor Details

    • GeolocationOptions

      public GeolocationOptions()
      Creates options with all values set to null, meaning the browser's defaults will be used.
    • GeolocationOptions

      public GeolocationOptions(Boolean enableHighAccuracy, Integer timeout, Integer maximumAge)
      Creates an instance of a GeolocationOptions record class.
      Parameters:
      enableHighAccuracy - the value for the enableHighAccuracy record component
      timeout - the value for the timeout record component
      maximumAge - the value for the maximumAge record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • enableHighAccuracy

      public Boolean enableHighAccuracy()
      Returns the value of the enableHighAccuracy record component.
      Returns:
      the value of the enableHighAccuracy record component
    • timeout

      public Integer timeout()
      Returns the value of the timeout record component.
      Returns:
      the value of the timeout record component
    • maximumAge

      public Integer maximumAge()
      Returns the value of the maximumAge record component.
      Returns:
      the value of the maximumAge record component