Record Class GeolocationCoordinates
java.lang.Object
java.lang.Record
com.vaadin.flow.component.geolocation.GeolocationCoordinates
- Record Components:
latitude- the latitude in decimal degreeslongitude- the longitude in decimal degreesaccuracy- the accuracy of the position in metersaltitude- the altitude in meters above the WGS84 ellipsoid, ornullif not availablealtitudeAccuracy- the accuracy of the altitude in meters, ornullif not availableheading- the direction of travel in degrees (0-360), ornullif not availablespeed- the speed in meters per second, ornullif 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 Summary
ConstructorsConstructorDescriptionGeolocationCoordinates(double latitude, double longitude, double accuracy, Double altitude, Double altitudeAccuracy, Double heading, Double speed) Creates an instance of aGeolocationCoordinatesrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleaccuracy()Returns the value of theaccuracyrecord component.altitude()Returns the value of thealtituderecord component.Returns the value of thealtitudeAccuracyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.heading()Returns the value of theheadingrecord component.doublelatitude()Returns the value of thelatituderecord component.doubleReturns the value of thelongituderecord component.speed()Returns the value of thespeedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
GeolocationCoordinates
public GeolocationCoordinates(double latitude, double longitude, double accuracy, Double altitude, Double altitudeAccuracy, Double heading, Double speed) Creates an instance of aGeolocationCoordinatesrecord class.- Parameters:
latitude- the value for thelatituderecord componentlongitude- the value for thelongituderecord componentaccuracy- the value for theaccuracyrecord componentaltitude- the value for thealtituderecord componentaltitudeAccuracy- the value for thealtitudeAccuracyrecord componentheading- the value for theheadingrecord componentspeed- the value for thespeedrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
latitude
public double latitude()Returns the value of thelatituderecord component.- Returns:
- the value of the
latituderecord component
-
longitude
public double longitude()Returns the value of thelongituderecord component.- Returns:
- the value of the
longituderecord component
-
accuracy
public double accuracy()Returns the value of theaccuracyrecord component.- Returns:
- the value of the
accuracyrecord component
-
altitude
Returns the value of thealtituderecord component.- Returns:
- the value of the
altituderecord component
-
altitudeAccuracy
Returns the value of thealtitudeAccuracyrecord component.- Returns:
- the value of the
altitudeAccuracyrecord component
-
heading
Returns the value of theheadingrecord component.- Returns:
- the value of the
headingrecord component
-
speed
Returns the value of thespeedrecord component.- Returns:
- the value of the
speedrecord component
-