public class DefaultMetaDataHolder extends java.lang.Object implements MetaDataHolder
Constructor and Description |
---|
DefaultMetaDataHolder() |
DefaultMetaDataHolder(java.util.Map<java.lang.String,java.lang.Object> bundle) |
Modifier and Type | Method and Description |
---|---|
static void |
bundleToMetaMap(android.os.Bundle bundle,
java.util.Map<java.lang.String,java.lang.Object> map) |
void |
copyMetaData(java.util.Map<java.lang.String,java.lang.Object> bundle)
Copies the metadata in the specified bundle into this metadata.
|
<T> T |
get(java.lang.String key)
Returns the value associated with the given key, or null if
no mapping of the desired type exists for the given key or a null
value is explicitly associated with the key.
|
boolean |
getMetaBoolean(java.lang.String key,
boolean fallbackValue)
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given key.
|
void |
getMetaData(java.util.Map<java.lang.String,java.lang.Object> bundle)
Returns a copy of the current metadata in the specified bundle.
|
double |
getMetaDouble(java.lang.String key,
double fallbackValue)
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given key.
|
int[] |
getMetaIntArray(java.lang.String key)
Returns the value associated with the given key, or null if
no mapping of the desired type exists for the given key or a null
value is explicitly associated with the key.
|
int |
getMetaInteger(java.lang.String key,
int fallbackValue)
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given key.
|
long |
getMetaLong(java.lang.String key,
long fallbackValue)
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given key.
|
java.util.Map<java.lang.String,java.lang.Object> |
getMetaMap(java.lang.String key)
Returns the bundle associated with the specified key.
|
<T extends android.os.Parcelable> |
getMetaParcelable(java.lang.String key)
Returns the value associated with the given key, or null if
no mapping of the desired type exists for the given key or a null
value is explicitly associated with the key.
|
java.io.Serializable |
getMetaSerializable(java.lang.String key)
Returns the value associated with the given key, or null if
no mapping of the desired type exists for the given key or a null
value is explicitly associated with the key.
|
java.lang.String |
getMetaString(java.lang.String key,
java.lang.String fallbackValue)
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given key or if a null
value is explicitly associated with the given key.
|
java.util.ArrayList<java.lang.String> |
getMetaStringArrayList(java.lang.String key)
Returns the value associated with the given key, or null if
no mapping of the desired type exists for the given key or a null
value is explicitly associated with the key.
|
boolean |
hasMetaValue(java.lang.String key)
Returns
true if there is a metadata value associated with the specified key,
false otherwise. |
static void |
metaMapToBundle(java.util.Map<java.lang.String,java.lang.Object> map,
android.os.Bundle bundle,
boolean deep) |
void |
removeMetaData(java.lang.String key)
Removes the metadata associated with the specified key.
|
void |
setMetaBoolean(java.lang.String key,
boolean value)
Inserts a Boolean value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaData(java.util.Map<java.lang.String,java.lang.Object> bundle)
Sets this metadata to the metadata in the specified bundle.
|
void |
setMetaDouble(java.lang.String key,
double value)
Inserts a double value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaIntArray(java.lang.String key,
int[] value)
Inserts an int array value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaInteger(java.lang.String key,
int value)
Inserts an int value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaLong(java.lang.String key,
long value)
Inserts a long value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaMap(java.lang.String key,
java.util.Map<java.lang.String,java.lang.Object> bundle)
Sets the bundle associated with the specified key.
|
void |
setMetaParcelable(java.lang.String key,
android.os.Parcelable value)
Inserts a Parcelable value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaSerializable(java.lang.String key,
java.io.Serializable value)
Inserts a Serializable value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaString(java.lang.String key,
java.lang.String value)
Inserts a String value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaStringArrayList(java.lang.String key,
java.util.ArrayList<java.lang.String> value)
Inserts an ArrayList
|
public DefaultMetaDataHolder()
public DefaultMetaDataHolder(java.util.Map<java.lang.String,java.lang.Object> bundle)
public final java.lang.String getMetaString(java.lang.String key, java.lang.String fallbackValue)
MetaDataHolder
getMetaString
in interface MetaDataHolder
key
- a String, or nullfallbackValue
- Value to return if key does not exist or if a null
value is associated with the given key.public final void setMetaString(java.lang.String key, java.lang.String value)
MetaDataHolder
setMetaString
in interface MetaDataHolder
key
- a String, or nullvalue
- a String, or nullpublic final int getMetaInteger(java.lang.String key, int fallbackValue)
MetaDataHolder
getMetaInteger
in interface MetaDataHolder
key
- a StringfallbackValue
- Value to return if key does not existpublic final void setMetaInteger(java.lang.String key, int value)
MetaDataHolder
setMetaInteger
in interface MetaDataHolder
key
- a String, or nullvalue
- an intpublic final double getMetaDouble(java.lang.String key, double fallbackValue)
MetaDataHolder
getMetaDouble
in interface MetaDataHolder
key
- a StringfallbackValue
- Value to return if key does not existpublic final void setMetaDouble(java.lang.String key, double value)
MetaDataHolder
setMetaDouble
in interface MetaDataHolder
key
- a String, or nullvalue
- a doublepublic final boolean getMetaBoolean(java.lang.String key, boolean fallbackValue)
MetaDataHolder
getMetaBoolean
in interface MetaDataHolder
key
- a StringfallbackValue
- Value to return if key does not existpublic final <T> T get(java.lang.String key)
MetaDataHolder
get
in interface MetaDataHolder
key
- a String, or nullpublic final void setMetaBoolean(java.lang.String key, boolean value)
MetaDataHolder
setMetaBoolean
in interface MetaDataHolder
key
- a String, or nullvalue
- a booleanpublic final boolean hasMetaValue(java.lang.String key)
MetaDataHolder
true
if there is a metadata value associated with the specified key,
false
otherwise.hasMetaValue
in interface MetaDataHolder
public final void setMetaData(java.util.Map<java.lang.String,java.lang.Object> bundle)
MetaDataHolder
setMetaData
in interface MetaDataHolder
public final void copyMetaData(java.util.Map<java.lang.String,java.lang.Object> bundle)
MetaDataHolder
copyMetaData
in interface MetaDataHolder
public final void getMetaData(java.util.Map<java.lang.String,java.lang.Object> bundle)
MetaDataHolder
getMetaData
in interface MetaDataHolder
public final long getMetaLong(java.lang.String key, long fallbackValue)
MetaDataHolder
getMetaLong
in interface MetaDataHolder
key
- a StringfallbackValue
- Value to return if key does not existpublic final void setMetaLong(java.lang.String key, long value)
MetaDataHolder
setMetaLong
in interface MetaDataHolder
key
- a String, or nullvalue
- a longpublic final void removeMetaData(java.lang.String key)
MetaDataHolder
removeMetaData
in interface MetaDataHolder
public final java.util.Map<java.lang.String,java.lang.Object> getMetaMap(java.lang.String key)
MetaDataHolder
getMetaMap
in interface MetaDataHolder
public final void setMetaMap(java.lang.String key, java.util.Map<java.lang.String,java.lang.Object> bundle)
MetaDataHolder
bundle
after the method returns will not be
reflected in the underlying metadata.setMetaMap
in interface MetaDataHolder
public final java.util.ArrayList<java.lang.String> getMetaStringArrayList(java.lang.String key)
MetaDataHolder
getMetaStringArrayList
in interface MetaDataHolder
key
- a String, or nullpublic final void setMetaStringArrayList(java.lang.String key, java.util.ArrayList<java.lang.String> value)
MetaDataHolder
setMetaStringArrayList
in interface MetaDataHolder
key
- a String, or nullvalue
- an ArrayListpublic final int[] getMetaIntArray(java.lang.String key)
MetaDataHolder
getMetaIntArray
in interface MetaDataHolder
key
- a String, or nullpublic final void setMetaIntArray(java.lang.String key, int[] value)
MetaDataHolder
setMetaIntArray
in interface MetaDataHolder
key
- a String, or nullvalue
- an int array object, or nullpublic final java.io.Serializable getMetaSerializable(java.lang.String key)
MetaDataHolder
getMetaSerializable
in interface MetaDataHolder
key
- a String, or nullpublic final void setMetaSerializable(java.lang.String key, java.io.Serializable value)
MetaDataHolder
setMetaSerializable
in interface MetaDataHolder
key
- a String, or nullvalue
- a Serializable object, or nullpublic final <T extends android.os.Parcelable> T getMetaParcelable(java.lang.String key)
MetaDataHolder
getMetaParcelable
in interface MetaDataHolder
key
- a String, or nullpublic final void setMetaParcelable(java.lang.String key, android.os.Parcelable value)
MetaDataHolder
setMetaParcelable
in interface MetaDataHolder
key
- a String, or nullvalue
- a Parcelable object, or nullpublic static void metaMapToBundle(java.util.Map<java.lang.String,java.lang.Object> map, android.os.Bundle bundle, boolean deep)
public static void bundleToMetaMap(android.os.Bundle bundle, java.util.Map<java.lang.String,java.lang.Object> map)