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 classGeoLocation.BuilderThis class defines a builder class forGeoLocation.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringELEMENTstatic GeoLocationEMPTY_GEO_LOCATIONstatic java.lang.StringNAMESPACEstatic javax.xml.namespace.QNameQNAME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static GeoLocation.Builderbuilder()Returns a new instance ofGeoLocation.Builder.booleanequals(java.lang.Object obj)static GeoLocationfrom(Message message)Returns the first GeoLocation, ornullif it doesn't exist inMessage.static GeoLocationfrom(FormField formField)Returns the first GeoLocation, ornullif it doesn't exist inFormField.java.lang.DoublegetAccuracy()java.lang.DoublegetAlt()java.lang.DoublegetAltAccuracy()java.lang.StringgetArea()java.lang.DoublegetBearing()java.lang.StringgetBuilding()java.lang.StringgetCountry()java.lang.StringgetCountryCode()java.lang.StringgetDatum()java.lang.StringgetDescription()java.lang.StringgetElementName()Returns the root element name.java.lang.DoublegetError()Deprecated.usegetAccuracy()instead.java.lang.StringgetFloor()java.lang.DoublegetLat()java.lang.StringgetLocality()java.lang.DoublegetLon()java.lang.StringgetNamespace()Returns the root element XML namespace.java.lang.StringgetPostalcode()javax.xml.namespace.QNamegetQName()java.lang.StringgetRegion()java.lang.StringgetRoom()java.lang.DoublegetSpeed()java.lang.StringgetStreet()java.lang.StringgetText()java.util.DategetTimestamp()java.lang.StringgetTzo()java.net.URIgetUri()inthashCode()booleanisExclusiveElement()java.lang.CharSequencetoXML(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:
getQNamein interfaceFullyQualifiedElement
-
getElementName
public java.lang.String getElementName()
Description copied from interface:NamedElementReturns the root element name.- Specified by:
getElementNamein interfaceNamedElement- Returns:
- the element name.
-
toXML
public java.lang.CharSequence toXML(XmlEnvironment enclosingNamespace)
-
getNamespace
public java.lang.String getNamespace()
Description copied from interface:FullyQualifiedElementReturns the root element XML namespace.- Specified by:
getNamespacein interfaceFullyQualifiedElement- Returns:
- the namespace.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
builder
public static GeoLocation.Builder builder()
Returns a new instance ofGeoLocation.Builder.- Returns:
- Builder
-
isExclusiveElement
public boolean isExclusiveElement()
- Specified by:
isExclusiveElementin 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
-
-