Class GeoLocation
- java.lang.Object
-
- org.jivesoftware.smackx.geoloc.packet.GeoLocation
-
- All Implemented Interfaces:
java.io.Serializable
,Element
,ExtensionElement
,FullyQualifiedElement
,NamedElement
,XmlLangElement
,FormFieldChildElement
public final class GeoLocation extends java.lang.Object implements java.io.Serializable, ExtensionElement, FormFieldChildElement
A GeoLocation Extension packet, which is used by the XMPP clients to exchange their respective geographic locations.- See Also:
- XEP-0080, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GeoLocation.Builder
This class defines a builder class forGeoLocation
.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ELEMENT
static GeoLocation
EMPTY_GEO_LOCATION
static java.lang.String
NAMESPACE
static javax.xml.namespace.QName
QNAME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static GeoLocation.Builder
builder()
Returns a new instance ofGeoLocation.Builder
.boolean
equals(java.lang.Object obj)
static GeoLocation
from(Message message)
Returns the first GeoLocation, ornull
if it doesn't exist inMessage
.static GeoLocation
from(FormField formField)
Returns the first GeoLocation, ornull
if it doesn't exist inFormField
.java.lang.Double
getAccuracy()
java.lang.Double
getAlt()
java.lang.Double
getAltAccuracy()
java.lang.String
getArea()
java.lang.Double
getBearing()
java.lang.String
getBuilding()
java.lang.String
getCountry()
java.lang.String
getCountryCode()
java.lang.String
getDatum()
java.lang.String
getDescription()
java.lang.String
getElementName()
Returns the root element name.java.lang.Double
getError()
Deprecated.usegetAccuracy()
instead.java.lang.String
getFloor()
java.lang.Double
getLat()
java.lang.String
getLocality()
java.lang.Double
getLon()
java.lang.String
getNamespace()
Returns the root element XML namespace.java.lang.String
getPostalcode()
javax.xml.namespace.QName
getQName()
java.lang.String
getRegion()
java.lang.String
getRoom()
java.lang.Double
getSpeed()
java.lang.String
getStreet()
java.lang.String
getText()
java.util.Date
getTimestamp()
java.lang.String
getTzo()
java.net.URI
getUri()
int
hashCode()
boolean
isExclusiveElement()
java.lang.CharSequence
toXML(XmlEnvironment enclosingNamespace)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jivesoftware.smackx.xdata.FormFieldChildElement
checkConsistency, mustBeOnlyOfHisKind, requiresNoTypeSet, validate
-
Methods inherited from interface org.jivesoftware.smack.packet.FullyQualifiedElement
getLanguage
-
-
-
-
Field Detail
-
NAMESPACE
public static final java.lang.String NAMESPACE
- See Also:
- Constant Field Values
-
ELEMENT
public static final java.lang.String ELEMENT
- See Also:
- Constant Field Values
-
QNAME
public static final javax.xml.namespace.QName QNAME
-
EMPTY_GEO_LOCATION
public static final GeoLocation EMPTY_GEO_LOCATION
-
-
Method Detail
-
getAccuracy
public java.lang.Double getAccuracy()
-
getAlt
public java.lang.Double getAlt()
-
getAltAccuracy
public java.lang.Double getAltAccuracy()
-
getArea
public java.lang.String getArea()
-
getBearing
public java.lang.Double getBearing()
-
getBuilding
public java.lang.String getBuilding()
-
getCountry
public java.lang.String getCountry()
-
getCountryCode
public java.lang.String getCountryCode()
-
getDatum
public java.lang.String getDatum()
-
getDescription
public java.lang.String getDescription()
-
getError
@Deprecated public java.lang.Double getError()
Deprecated.usegetAccuracy()
instead.Get the error.- Returns:
- the error.
-
getFloor
public java.lang.String getFloor()
-
getLat
public java.lang.Double getLat()
-
getLocality
public java.lang.String getLocality()
-
getLon
public java.lang.Double getLon()
-
getPostalcode
public java.lang.String getPostalcode()
-
getRegion
public java.lang.String getRegion()
-
getRoom
public java.lang.String getRoom()
-
getSpeed
public java.lang.Double getSpeed()
-
getStreet
public java.lang.String getStreet()
-
getText
public java.lang.String getText()
-
getTimestamp
public java.util.Date getTimestamp()
-
getTzo
public java.lang.String getTzo()
-
getUri
public java.net.URI getUri()
-
getQName
public javax.xml.namespace.QName getQName()
- Specified by:
getQName
in interfaceFullyQualifiedElement
-
getElementName
public java.lang.String getElementName()
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
toXML
public java.lang.CharSequence toXML(XmlEnvironment enclosingNamespace)
-
getNamespace
public java.lang.String getNamespace()
Description copied from interface:FullyQualifiedElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceFullyQualifiedElement
- Returns:
- the namespace.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
builder
public static GeoLocation.Builder builder()
Returns a new instance ofGeoLocation.Builder
.- Returns:
- Builder
-
isExclusiveElement
public boolean isExclusiveElement()
- Specified by:
isExclusiveElement
in interfaceFormFieldChildElement
-
from
public static GeoLocation from(Message message)
- Parameters:
message
- The Message stanza containing GeoLocation- Returns:
- GeoLocation
-
from
public static GeoLocation from(FormField formField)
- Parameters:
formField
- the Formfield containing GeoLocation- Returns:
- GeoLocation
-
-