Record Class GeolocationCoordinates

java.lang.Object
java.lang.Record
com.vaadin.flow.component.geolocation.GeolocationCoordinates
Record Components:
latitude - the latitude in decimal degrees
longitude - the longitude in decimal degrees
accuracy - the accuracy of the position in meters
altitude - the altitude in meters above the WGS84 ellipsoid, or null if not available
altitudeAccuracy - the accuracy of the altitude in meters, or null if not available
heading - the direction of travel in degrees (0-360), or null if not available
speed - the speed in meters per second, or null if not available
All Implemented Interfaces:
Serializable

public record GeolocationCoordinates(double latitude, double longitude, double accuracy, Double altitude, Double altitudeAccuracy, Double heading, Double speed) extends Record implements Serializable
Represents geographic coordinates as returned by the browser's Geolocation API.
See Also:
  • Constructor Details

    • GeolocationCoordinates

      public GeolocationCoordinates(double latitude, double longitude, double accuracy, Double altitude, Double altitudeAccuracy, Double heading, Double speed)
      Creates an instance of a GeolocationCoordinates record class.
      Parameters:
      latitude - the value for the latitude record component
      longitude - the value for the longitude record component
      accuracy - the value for the accuracy record component
      altitude - the value for the altitude record component
      altitudeAccuracy - the value for the altitudeAccuracy record component
      heading - the value for the heading record component
      speed - the value for the speed 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • latitude

      public double latitude()
      Returns the value of the latitude record component.
      Returns:
      the value of the latitude record component
    • longitude

      public double longitude()
      Returns the value of the longitude record component.
      Returns:
      the value of the longitude record component
    • accuracy

      public double accuracy()
      Returns the value of the accuracy record component.
      Returns:
      the value of the accuracy record component
    • altitude

      public Double altitude()
      Returns the value of the altitude record component.
      Returns:
      the value of the altitude record component
    • altitudeAccuracy

      public Double altitudeAccuracy()
      Returns the value of the altitudeAccuracy record component.
      Returns:
      the value of the altitudeAccuracy record component
    • heading

      public Double heading()
      Returns the value of the heading record component.
      Returns:
      the value of the heading record component
    • speed

      public Double speed()
      Returns the value of the speed record component.
      Returns:
      the value of the speed record component