public final class GeoLocation
extends java.lang.Object
The implementation of the <geoloc/>
element in the http://jabber.org/protocol/geoloc
namespace.
This class represents the geological location of a user.
Location information about human users SHOULD be communicated and transported by means of Publish-Subscribe (XEP-0060) [5] or the subset thereof specified in Personal Eventing Protocol (XEP-0163) [6].
Although the XMPP publish-subscribe extension is the preferred means for transporting location information about human users, applications that do not involve human users (e.g., device tracking) MAY use other transport methods; however, because location information is not pure presence information and can change independently of network availability, it SHOULD NOT be provided as an extension to
<presence/>
.
GeoLocation geoLocation = GeoLocation.builder()
.countryCode("de")
.latitude(50.2)
.longitude(7.5)
.timeZoneOffset(ZoneOffset.of("+01:00"))
.build();
Modifier and Type | Class and Description |
---|---|
static class |
GeoLocation.Builder
A builder class to which builds geo location objects.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAMESPACE
|
Modifier and Type | Method and Description |
---|---|
static GeoLocation.Builder |
builder()
Creates the builder to build a geo location.
|
java.lang.Double |
getAccuracy()
Gets the horizontal GPS error in meters.
|
java.lang.Double |
getAltitude()
Gets the altitude in meters above or below sea level.
|
java.lang.Double |
getAltitudeAccuracy()
Gets the vertical GPS error in meters.
|
java.lang.String |
getArea()
Gets a named area such as a campus or neighborhood.
|
java.lang.Double |
getBearing()
Gets the GPS bearing (direction in which the entity is heading to reach its next waypoint), measured in decimal degrees relative to true north.
|
java.lang.String |
getBuilding()
Gets a specific building on a street or in an area.
|
java.lang.String |
getCountry()
Gets the nation where the user is located.
|
java.lang.String |
getCountryCode()
Gets the ISO 3166 two-letter country code.
|
java.lang.String |
getDatum()
Gets the GPS datum.
|
java.lang.String |
getDescription()
Gets a natural-language name for or description of the location.
|
java.lang.String |
getFloor()
Gets a particular floor in a building.
|
java.util.Locale |
getLanguage()
Gets the the natural language of location data.
|
java.lang.Double |
getLatitude()
Gets the latitude in decimal degrees North.
|
java.lang.String |
getLocality()
Gets a locality within the administrative region, such as a town or city.
|
java.lang.Double |
getLongitude()
Gets the longitude in decimal degrees East.
|
java.lang.String |
getPostalCode()
Gets a code used for postal delivery.
|
java.lang.String |
getRegion()
Gets an administrative region of the nation, such as a state or province.
|
java.lang.String |
getRoom()
Gets a particular room in a building.
|
java.lang.Double |
getSpeed()
Gets the speed at which the entity is moving, in meters per second.
|
java.lang.String |
getStreet()
Gets a thoroughfare within the locality, or a crossing of two thoroughfares.
|
java.lang.String |
getText()
Gets a catch-all element that captures any other information about the location.
|
java.time.Instant |
getTimestamp()
Gets the UTC timestamp specifying the moment when the reading was taken.
|
java.time.ZoneOffset |
getTimeZoneOffset()
Gets the time zone offset from UTC for the current location.
|
java.net.URI |
getUri()
Gets a URI or URL pointing to information about the location.
|
java.lang.String |
toString() |
public static final java.lang.String NAMESPACE
public static GeoLocation.Builder builder()
Creates the builder to build a geo location.
public final java.lang.Double getAccuracy()
Gets the horizontal GPS error in meters.
public final java.lang.Double getAltitude()
Gets the altitude in meters above or below sea level.
public final java.lang.Double getAltitudeAccuracy()
Gets the vertical GPS error in meters.
public final java.lang.String getArea()
Gets a named area such as a campus or neighborhood.
public final java.lang.Double getBearing()
Gets the GPS bearing (direction in which the entity is heading to reach its next waypoint), measured in decimal degrees relative to true north.
public final java.lang.String getBuilding()
Gets a specific building on a street or in an area.
public final java.lang.String getCountry()
Gets the nation where the user is located.
public final java.lang.String getCountryCode()
Gets the ISO 3166 two-letter country code.
public final java.lang.String getDatum()
Gets the GPS datum.
public final java.lang.String getDescription()
Gets a natural-language name for or description of the location.
public final java.lang.String getFloor()
Gets a particular floor in a building.
public final java.lang.Double getLatitude()
Gets the latitude in decimal degrees North.
public final java.lang.String getLocality()
Gets a locality within the administrative region, such as a town or city.
public final java.lang.Double getLongitude()
Gets the longitude in decimal degrees East.
public final java.lang.String getPostalCode()
Gets a code used for postal delivery.
public final java.lang.String getRegion()
Gets an administrative region of the nation, such as a state or province.
public final java.lang.String getRoom()
Gets a particular room in a building.
public final java.lang.Double getSpeed()
Gets the speed at which the entity is moving, in meters per second.
public final java.lang.String getStreet()
Gets a thoroughfare within the locality, or a crossing of two thoroughfares.
public final java.lang.String getText()
Gets a catch-all element that captures any other information about the location.
public final java.time.Instant getTimestamp()
Gets the UTC timestamp specifying the moment when the reading was taken.
public final java.net.URI getUri()
Gets a URI or URL pointing to information about the location.
public final java.util.Locale getLanguage()
Gets the the natural language of location data.
public final java.time.ZoneOffset getTimeZoneOffset()
Gets the time zone offset from UTC for the current location.
public final java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2014–2019 XMPP.rocks. All rights reserved.