Package android.os

Class PersistableBundle

    • Constructor Detail

      • PersistableBundle

        public PersistableBundle()
        Constructs a new, empty PersistableBundle.
      • PersistableBundle

        public PersistableBundle​(int capacity)
        Constructs a new, empty PersistableBundle sized to hold the given number of elements. The PersistableBundle will grow as needed.
        Parameters:
        capacity - the initial capacity of the PersistableBundle
      • PersistableBundle

        public PersistableBundle​(PersistableBundle b)
        Constructs a PersistableBundle containing a copy of the mappings from the given PersistableBundle.
        Parameters:
        b - a PersistableBundle to be copied.
    • Method Detail

      • isValidType

        public static boolean isValidType​(Object value)
      • clone

        public Object clone()
        Clones the current PersistableBundle. The internal map is cloned, but the keys and values to which it refers are copied by reference.
        Overrides:
        clone in class Object
        Returns:
        a copy of this object.
      • putPersistableBundle

        public void putPersistableBundle​(String key,
                                         PersistableBundle value)
        Inserts a PersistableBundle value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
        Parameters:
        key - a String, or null
        value - a Bundle object, or null
      • getPersistableBundle

        public 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.
        Parameters:
        key - a String, or null
        Returns:
        a Bundle value, or null
      • describeContents

        public int describeContents()
        Report the nature of this Parcelable's contents
        Specified by:
        describeContents in interface Parcelable
        Returns:
        a bitmask indicating the set of special object types marshalled by the Parcelable.
      • writeToParcel

        public 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.
        Specified by:
        writeToParcel in interface Parcelable
        Parameters:
        parcel - 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.
      • toString

        public String toString()
        Description copied from class: Object
        Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
           getClass().getName() + '@' + Integer.toHexString(hashCode())

        See Writing a useful toString method if you intend implementing your own toString method.

        Overrides:
        toString in class Object
        Returns:
        a printable representation of this object.