Metadata (API Reference)
Class Metadata
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 -
Method Summary
Modifier and TypeMethodDescriptiongetCustomValue(String key) Obtains an instance of the CustomMetadataValue class associated with a given key.Obtains a Double value associated with a given key.getGeoCoordinates(String key) Obtains a GeoCoordinates value associated with a given key.getInteger(String key) Obtains an Integer value associated with a given key.Obtains a String value associated with a given key.Determines the type of a metadata value.voidremoveValue(String key) Removes a metadata key and its associated value.voidsetCustomValue(String key, CustomMetadataValue value) Creates a key:value pair, where the value is a type derived from CustomMetadataValue.voidCreates a key:value pair, where the value is of type Double.voidsetGeoCoordinates(String key, GeoCoordinates value) Creates a key:value pair, where the value is of type GeoCoordinates.voidsetInteger(String key, int value) Creates a key:value pair, where the value is of type Integer.voidCreates a key:value pair, where the value is of type String.
-
Constructor Details
-
Metadata
public Metadata()Creates an instance of this class.
-
-
Method Details
-
getCustomValue
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
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
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
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
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
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
Removes a metadata key and its associated value.
- Parameters:
key-The name of the key to be removed.
-
setCustomValue
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
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
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
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
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.
-