public interface Metadata
MetadataHolder
instance or
a parent Metadata
object.Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all key-value pairs from this
Metadata object. |
boolean |
containsKey(String key)
Returns whether the given key is defined for this
Metadata
object. |
boolean |
containsValue(Object value)
Returns whether the given value is contained by this
Metadata
object. |
Metadata |
createStructure(String key)
|
ImmutableSet<? extends Map.Entry<String,?>> |
entrySet()
|
<T> Optional<T> |
get(String key)
Gets the value assigned to the given key.
|
ImmutableSet<String> |
getAllKeys()
Deprecated.
Poorly named - use
keySet() |
boolean |
has(String key)
Deprecated.
Ambiguous name - use
containsKey(java.lang.String) |
ImmutableSet<String> |
keySet()
Returns an
ImmutableSet of all keys contained by this
Metadata object. |
boolean |
remove(String key)
Removes the given key and its data from this
Metadata object. |
<T> void |
set(String key,
T value)
Assigns the given value to the given key.
|
ImmutableCollection<?> |
values()
Returns an
ImmutableCollection of all values contained by this
Metadata object. |
boolean containsKey(String key)
Metadata
object.key
- The key to checkMetadata
objectboolean containsValue(Object value)
Metadata
object.value
- The value to checkMetadata
object@Deprecated boolean has(String key)
containsKey(java.lang.String)
Metadata
object.key
- The key to checkMetadata
object<T> Optional<T> get(String key) throws ClassCastException
T
- The type of data associated with the given keykey
- The key of the value to retrieveOptional.absent()
if the key is not definedClassCastException
- If the value associated with the given key is
assignable from the generic parameter type T
(Note that
this exception is not thrown by this method directly, but rather by
the JVM upon its invocation)<T> void set(String key, T value)
T
- The type of data to be assignedkey
- The key to setvalue
- The value to assign to the keyMetadata createStructure(String key) throws IllegalArgumentException
Metadata
object as another
Metadata
instance and assigns it to the given key.key
- The key to assign the new structure toMetadata
objectIllegalArgumentException
- If a value is already assigned to the
given keyboolean remove(String key)
Metadata
object.key
- The key to removetrue
if the key was removed; false
if
it was not present in this Metadata
object@Deprecated ImmutableSet<String> getAllKeys()
keySet()
ImmutableSet
of all keys contained by this
Metadata
object.ImmutableSet
of all keys contained by this
Metadata
objectImmutableSet<String> keySet()
ImmutableSet
of all keys contained by this
Metadata
object.ImmutableSet
of all keys contained by this
Metadata
objectImmutableCollection<?> values()
ImmutableCollection
of all values contained by this
Metadata
object.ImmutableCollection
of all values contained by this
Metadata
objectImmutableSet<? extends Map.Entry<String,?>> entrySet()
ImmutableSet
of all entries
contained by this Metadata
objectvoid clear()
Metadata
object.