Class Annotation<T extends com.mapbox.geojson.Geometry>
- java.lang.Object
-
- com.mapbox.mapboxsdk.plugins.annotation.Annotation<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected Tgeometryprotected com.google.gson.JsonObjectjsonObject
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)com.google.gson.JsonElementgetData()Get the arbitrary json object data of the annotation.TgetGeometry()Get the geometry of an annotation, type of geometry returned depends on the generic attribute.longgetId()Returns this annotation's internal ID.inthashCode()booleanisDraggable()Returns whether this annotation is draggable, meaning it can be dragged across the screen when touched and moved.voidsetData(com.google.gson.JsonElement jsonElement)Set the arbitrary json data of the annotation.voidsetDraggable(boolean draggable)Set whether this annotation should be draggable, meaning it can be dragged across the screen when touched and moved.voidsetGeometry(T geometry)Set the geometry of an annotation, geometry type depends on the generic attribute.java.lang.StringtoString()
-
-
-
Field Detail
-
jsonObject
protected com.google.gson.JsonObject jsonObject
-
geometry
protected T extends com.mapbox.geojson.Geometry geometry
-
-
Method Detail
-
setGeometry
public void setGeometry(T geometry)
Set the geometry of an annotation, geometry type depends on the generic attribute.- Parameters:
geometry- an instance of a geometry type
-
getGeometry
public T getGeometry()
Get the geometry of an annotation, type of geometry returned depends on the generic attribute.- Returns:
- the geometry of the annotation
- Throws:
java.lang.IllegalStateException- if geometry hasn't been initialised
-
getId
public long getId()
Returns this annotation's internal ID.- Returns:
- annotation's internal ID
-
isDraggable
public boolean isDraggable()
Returns whether this annotation is draggable, meaning it can be dragged across the screen when touched and moved.- Returns:
- draggable when touched
-
setDraggable
public void setDraggable(boolean draggable)
Set whether this annotation should be draggable, meaning it can be dragged across the screen when touched and moved.- Parameters:
draggable- should be draggable
-
setData
public void setData(@Nullable com.google.gson.JsonElement jsonElement)Set the arbitrary json data of the annotation.- Parameters:
jsonElement- the arbitrary json object data
-
getData
@Nullable public com.google.gson.JsonElement getData()
Get the arbitrary json object data of the annotation.- Returns:
- the arbitrary json object data if set, else null
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-