Class Metadata
Class Metadata
- java.lang.Object
-
- com.here.NativeBase
-
- com.here.sdk.core.Metadata
-
public final class Metadata extends NativeBase
Holds metadata on behalf of a map item. An instance of this class can contain metadata items of varying types, such as String, Integer, Double, GeoCoordinates etc. and can also hold arbitrary metadata types by the use of the CustomMetadataValue interface.
-
-
Constructor Summary
Constructors Constructor Description Metadata()Creates an instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomMetadataValuegetCustomValue(java.lang.String key)Obtains an instance of the CustomMetadataValue class associated with a given key.java.lang.DoublegetDouble(java.lang.String key)Obtains a Double value associated with a given key.GeoCoordinatesgetGeoCoordinates(java.lang.String key)Obtains a GeoCoordinates value associated with a given key.java.lang.IntegergetInteger(java.lang.String key)Obtains an Integer value associated with a given key.java.lang.StringgetString(java.lang.String key)Obtains a String value associated with a given key.MetadataTypegetType(java.lang.String key)Determines the type of a metadata value.voidremoveValue(java.lang.String key)Removes a metadata key and its associated value.voidsetCustomValue(java.lang.String key, CustomMetadataValue value)Creates a key:value pair, where the value is a type derived from CustomMetadataValue.voidsetDouble(java.lang.String key, double value)Creates a key:value pair, where the value is of type Double.voidsetGeoCoordinates(java.lang.String key, GeoCoordinates value)Creates a key:value pair, where the value is of type GeoCoordinates.voidsetInteger(java.lang.String key, int value)Creates a key:value pair, where the value is of type Integer.voidsetString(java.lang.String key, java.lang.String value)Creates a key:value pair, where the value is of type String.
-
-
-
Method Detail
-
getCustomValue
@Nullable public CustomMetadataValue getCustomValue(@NonNull java.lang.String key)
Obtains an instance of the CustomMetadataValue class associated with a given key.
- Parameters:
key-The name of the key for which to obtain the value.
- Returns:
The value associated with the key.
-
getDouble
@Nullable public java.lang.Double getDouble(@NonNull java.lang.String key)Obtains a Double value associated with a given key.
- Parameters:
key-The name of the key for which to obtain the value.
- Returns:
The value associated with the key.
-
getGeoCoordinates
@Nullable public GeoCoordinates getGeoCoordinates(@NonNull java.lang.String key)
Obtains a GeoCoordinates value associated with a given key.
- Parameters:
key-The name of the key for which to obtain the value.
- Returns:
The value associated with the key.
-
getInteger
@Nullable public java.lang.Integer getInteger(@NonNull java.lang.String key)Obtains an Integer value associated with a given key.
- Parameters:
key-The name of the key for which to obtain the value.
- Returns:
The value associated with the key.
-
getString
@Nullable public java.lang.String getString(@NonNull java.lang.String key)Obtains a String value associated with a given key.
- Parameters:
key-The name of the key for which to obtain the value.
- Returns:
The value associated with the key.
-
getType
@Nullable public MetadataType getType(@NonNull java.lang.String key)
Determines the type of a metadata value. If the type of a metadata value associated with a key is not known, this method will enable the type to be queried, in order to know which get method to call. i.e. getDouble(), getInteger() etc.
- Parameters:
key-The name of the key for which to obtain the type.
- Returns:
An enumeration describing the type of the value associated with the key.
-
removeValue
public void removeValue(@NonNull java.lang.String key)Removes a metadata key and its associated value.
- Parameters:
key-The name of the key to be removed.
-
setCustomValue
public void setCustomValue(@NonNull java.lang.String key, @NonNull CustomMetadataValue value)Creates a key:value pair, where the value is a type derived from CustomMetadataValue. If the given key already exists, its value will be replaced by the new one.
- Parameters:
key-The name of the key to be created or replaced.
value-The value to be assigned to the key.
-
setDouble
public void setDouble(@NonNull java.lang.String key, double value)Creates a key:value pair, where the value is of type Double. If the given key already exists, its value will be replaced by the new one.
- Parameters:
key-The name of the key to be created or replaced.
value-The value to be assigned to the key.
-
setGeoCoordinates
public void setGeoCoordinates(@NonNull java.lang.String key, @NonNull GeoCoordinates value)Creates a key:value pair, where the value is of type GeoCoordinates. If the given key already exists, its value will be replaced by the new one.
- Parameters:
key-The name of the key to be created or replaced.
value-The value to be assigned to the key.
-
setInteger
public void setInteger(@NonNull java.lang.String key, int value)Creates a key:value pair, where the value is of type Integer. If the given key already exists, its value will be replaced by the new one.
- Parameters:
key-The name of the key to be created or replaced.
value-The value to be assigned to the key.
-
setString
public void setString(@NonNull java.lang.String key, @NonNull java.lang.String value)Creates a key:value pair, where the value is of type String. If the given key already exists, its value will be replaced by the new one.
- Parameters:
key-The name of the key to be created or replaced.
value-The value to be assigned to the key.
-
-