public final class PersistableBundle extends BaseBundle implements Cloneable, Parcelable, XmlUtils.WriteMapCallback
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>| Modifier and Type | Field and Description |
|---|---|
static Parcelable.Creator<PersistableBundle> |
CREATOR |
static PersistableBundle |
EMPTY |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE| Constructor and Description |
|---|
PersistableBundle()
Constructs a new, empty PersistableBundle.
|
PersistableBundle(int capacity)
Constructs a new, empty PersistableBundle sized to hold the given number of
elements.
|
PersistableBundle(PersistableBundle b)
Constructs a PersistableBundle containing a copy of the mappings from the given
PersistableBundle.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Clones the current PersistableBundle.
|
int |
describeContents()
Report the nature of this Parcelable's contents
|
static PersistableBundle |
forPair(String key,
String value)
Make a PersistableBundle for a single key/value pair.
|
PersistableBundle |
getPersistableBundle(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.
|
static boolean |
isValidType(Object value) |
void |
putPersistableBundle(String key,
PersistableBundle value)
Inserts a PersistableBundle value into the mapping of this Bundle, replacing
any existing value for the given key.
|
static PersistableBundle |
restoreFromXml(XmlPullParser in) |
void |
saveToXml(XmlSerializer out) |
String |
toString()
Returns a string containing a concise, human-readable description of this
object.
|
void |
writeToParcel(Parcel parcel,
int flags)
Writes the PersistableBundle contents to a Parcel, typically in order for
it to be passed through an IBinder connection.
|
void |
writeUnknownObject(Object v,
String name,
XmlSerializer out)
Called from writeMapXml when an Object type is not recognized.
|
clear, containsKey, get, getDouble, getDouble, getDoubleArray, getInt, getInt, getIntArray, getLong, getLong, getLongArray, getPairValue, getString, getString, getStringArray, isEmpty, isParcelled, keySet, putAll, putDouble, putDoubleArray, putInt, putIntArray, putLong, putLongArray, putString, putStringArray, remove, sizepublic static final PersistableBundle EMPTY
public static final Parcelable.Creator<PersistableBundle> CREATOR
public PersistableBundle()
public PersistableBundle(int capacity)
capacity - the initial capacity of the PersistableBundlepublic PersistableBundle(PersistableBundle b)
b - a PersistableBundle to be copied.public static boolean isValidType(Object value)
public static PersistableBundle forPair(String key, String value)
public Object clone()
public void putPersistableBundle(String key, PersistableBundle value)
key - a String, or nullvalue - a Bundle object, or nullpublic PersistableBundle getPersistableBundle(String key)
key - a String, or nullpublic void writeUnknownObject(Object v, String name, XmlSerializer out) throws XmlPullParserException, IOException
XmlUtils.WriteMapCallbackwriteUnknownObject in interface XmlUtils.WriteMapCallbackv - The object to be written outname - The mapping key for v. Must be written into the "name" attribute of the
start tag.out - The XML output stream.XmlPullParserException - on unrecognized Object type.IOException - on XmlSerializer serialization errors.public void saveToXml(XmlSerializer out) throws IOException, XmlPullParserException
IOExceptionXmlPullParserExceptionpublic int describeContents()
describeContents in interface Parcelablepublic void writeToParcel(Parcel parcel, int flags)
writeToParcel in interface Parcelableparcel - The parcel to copy this bundle to.flags - Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.public static PersistableBundle restoreFromXml(XmlPullParser in) throws IOException, XmlPullParserException
IOExceptionXmlPullParserExceptionpublic String toString()
ObjectgetClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString method
if you intend implementing your own toString method.