Class GeoLocation.Builder
- java.lang.Object
-
- org.jivesoftware.smackx.geoloc.packet.GeoLocation.Builder
-
- Enclosing class:
- GeoLocation
public static class GeoLocation.Builder extends java.lang.Object
This class defines a builder class forGeoLocation
.
GeoLocation
instance can be obtained usingbuild()
method as follows.
GeoLocation.Builder builder = GeoLocation.builder();
GeoLocation geoLocation = builder.build();
To set GeoLocation parameters, use their respective setters.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GeoLocation
build()
This method is called to buildGeoLocation
from the Builder.GeoLocation.Builder
setAccuracy(java.lang.Double accuracy)
Sets accuracy of horizontal GPS error in meters.GeoLocation.Builder
setAlt(java.lang.Double alt)
Sets Altitude in meters above or below sea level.GeoLocation.Builder
setAltAccuracy(java.lang.Double altAccuracy)
Sets Vertical GPS error in meters.GeoLocation.Builder
setArea(java.lang.String area)
Sets a named area such as a campus or neighborhood.GeoLocation.Builder
setBearing(java.lang.Double bearing)
Sets GPS bearing (direction in which the entity is heading
to reach its next waypoint), measured in decimal degrees,
relative to true north.GeoLocation.Builder
setBuilding(java.lang.String building)
Sets a specific building on a street or in an area.GeoLocation.Builder
setCountry(java.lang.String country)
Sets the nation where the user is located.GeoLocation.Builder
setCountryCode(java.lang.String countryCode)
Sets The ISO 3166 two-letter country code.GeoLocation.Builder
setDatum(java.lang.String datum)
Sets GPS Datum.GeoLocation.Builder
setDescription(java.lang.String description)
Sets A natural-language name for or description of the location.GeoLocation.Builder
setError(java.lang.Double error)
Deprecated.usesetAccuracy(Double)
instead.GeoLocation.Builder
setFloor(java.lang.String floor)
Sets a particular floor in a building.GeoLocation.Builder
setLat(java.lang.Double lat)
Sets Latitude in decimal degrees North.GeoLocation.Builder
setLocality(java.lang.String locality)
Sets Locality within the administrative region,
such as a town or city.GeoLocation.Builder
setLon(java.lang.Double lon)
Sets Longitude in decimal degrees East.GeoLocation.Builder
setPostalcode(java.lang.String postalcode)
Sets PostalCode used for postal delivery.GeoLocation.Builder
setRegion(java.lang.String region)
Sets an administrative region of the nation,
such as a state or province.GeoLocation.Builder
setRoom(java.lang.String room)
Sets a particular room in a building.GeoLocation.Builder
setSpeed(java.lang.Double speed)
Sets Speed at which the entity is moving, in meters per second.GeoLocation.Builder
setStreet(java.lang.String street)
Sets a thoroughfare within the locality, or a crossing of two thoroughfares.GeoLocation.Builder
setText(java.lang.String text)
Sets a catch-all element that captures any other information about the location.GeoLocation.Builder
setTimestamp(java.util.Date timestamp)
Sets UTC timestamp specifying the moment when the reading was taken.GeoLocation.Builder
setTzo(java.lang.String tzo)
Sets the time zone offset from UTC for the current location.GeoLocation.Builder
setUri(java.net.URI uri)
Sets URI or URL pointing to information about the location.
-
-
-
Constructor Detail
-
Builder
public Builder()
-
-
Method Detail
-
setAccuracy
public GeoLocation.Builder setAccuracy(java.lang.Double accuracy)
Sets accuracy of horizontal GPS error in meters.- Parameters:
accuracy
- accuracy in meters- Returns:
- Builder
-
setAlt
public GeoLocation.Builder setAlt(java.lang.Double alt)
Sets Altitude in meters above or below sea level.- Parameters:
alt
- altitude in meters- Returns:
- Builder
-
setAltAccuracy
public GeoLocation.Builder setAltAccuracy(java.lang.Double altAccuracy)
Sets Vertical GPS error in meters.- Parameters:
altAccuracy
- altAccuracy in meters- Returns:
- Builder
-
setArea
public GeoLocation.Builder setArea(java.lang.String area)
Sets a named area such as a campus or neighborhood.- Parameters:
area
- the named area- Returns:
- Builder
-
setBearing
public GeoLocation.Builder setBearing(java.lang.Double bearing)
Sets GPS bearing (direction in which the entity is heading
to reach its next waypoint), measured in decimal degrees,
relative to true north.- Parameters:
bearing
- bearing in decimal degrees- Returns:
- Builder
-
setBuilding
public GeoLocation.Builder setBuilding(java.lang.String building)
Sets a specific building on a street or in an area.- Parameters:
building
- name of the building- Returns:
- Builder
-
setCountry
public GeoLocation.Builder setCountry(java.lang.String country)
Sets the nation where the user is located.- Parameters:
country
- user's country of location- Returns:
- Builder
-
setCountryCode
public GeoLocation.Builder setCountryCode(java.lang.String countryCode)
Sets The ISO 3166 two-letter country code.- Parameters:
countryCode
- two-letter country code- Returns:
- Builder
-
setDatum
public GeoLocation.Builder setDatum(java.lang.String datum)
Sets GPS Datum.- Parameters:
datum
- GPS datum- Returns:
- Builder
-
setDescription
public GeoLocation.Builder setDescription(java.lang.String description)
Sets A natural-language name for or description of the location.- Parameters:
description
- description of the location- Returns:
- Builder
-
setError
@Deprecated public GeoLocation.Builder setError(java.lang.Double error)
Deprecated.usesetAccuracy(Double)
instead.Sets Horizontal GPS error in arc minutes;
this element is deprecated in favor of accuracy.- Parameters:
error
- error in arc minutes- Returns:
- Builder
-
setFloor
public GeoLocation.Builder setFloor(java.lang.String floor)
Sets a particular floor in a building.- Parameters:
floor
- floor in a building- Returns:
- Builder
-
setLat
public GeoLocation.Builder setLat(java.lang.Double lat)
Sets Latitude in decimal degrees North.- Parameters:
lat
- latitude in decimal degrees- Returns:
- Builder
-
setLocality
public GeoLocation.Builder setLocality(java.lang.String locality)
Sets Locality within the administrative region,
such as a town or city.- Parameters:
locality
- locality in a region- Returns:
- Builder
-
setLon
public GeoLocation.Builder setLon(java.lang.Double lon)
Sets Longitude in decimal degrees East.- Parameters:
lon
- longitude in decimal degrees- Returns:
- Builder
-
setPostalcode
public GeoLocation.Builder setPostalcode(java.lang.String postalcode)
Sets PostalCode used for postal delivery.- Parameters:
postalcode
- code for postal delivery- Returns:
- Builder
-
setRegion
public GeoLocation.Builder setRegion(java.lang.String region)
Sets an administrative region of the nation,
such as a state or province.- Parameters:
region
- an administrative region- Returns:
- Builder
-
setRoom
public GeoLocation.Builder setRoom(java.lang.String room)
Sets a particular room in a building.- Parameters:
room
- room inside a building- Returns:
- Builder
-
setSpeed
public GeoLocation.Builder setSpeed(java.lang.Double speed)
Sets Speed at which the entity is moving, in meters per second.- Parameters:
speed
- speed in meters per second- Returns:
- Builder
-
setStreet
public GeoLocation.Builder setStreet(java.lang.String street)
Sets a thoroughfare within the locality, or a crossing of two thoroughfares.- Parameters:
street
- name of the street- Returns:
- Builder
-
setText
public GeoLocation.Builder setText(java.lang.String text)
Sets a catch-all element that captures any other information about the location.- Parameters:
text
- distinctive feature about the location- Returns:
- Builder
-
setTimestamp
public GeoLocation.Builder setTimestamp(java.util.Date timestamp)
Sets UTC timestamp specifying the moment when the reading was taken.- Parameters:
timestamp
- timestamp of the reading- Returns:
- Builder
-
setTzo
public GeoLocation.Builder setTzo(java.lang.String tzo)
Sets the time zone offset from UTC for the current location.- Parameters:
tzo
- time zone offset- Returns:
- Builder
-
setUri
public GeoLocation.Builder setUri(java.net.URI uri)
Sets URI or URL pointing to information about the location.- Parameters:
uri
- uri to the location- Returns:
- Builder
-
build
public GeoLocation build()
This method is called to buildGeoLocation
from the Builder.- Returns:
- GeoLocation
-
-