Package com.pspdfkit.utils
Class ParcelExtensions
-
- All Implemented Interfaces:
public final class ParcelExtensions
-
-
Method Summary
Modifier and Type Method Description final static <T extends Parcelable> List<T>
readSupportList(Parcel $self, List<T> list, Class<T> clazz)
Reads into the given list items containing a particular object type that were written with Parcel.writeTypedList at the current Parcel.dataPosition. final static <T extends Parcelable> T
readSupportParcelable(Parcel $self, ClassLoader classLoader, Class<T> clazz)
Reads a new Parcelable from the parcel. -
-
Method Detail
-
readSupportList
final static <T extends Parcelable> List<T> readSupportList(Parcel $self, List<T> list, Class<T> clazz)
Reads into the given list items containing a particular object type that were written with Parcel.writeTypedList at the current Parcel.dataPosition. The list <em>must</em> have previously been written via Parcel.writeTypedList with the same object type.
<p><b>Note: </b> This method will use the latest APIs introduced with [Build.VERSION_CODES#TIRAMISU], and will fall back on the older APIs on previous versions.- Parameters:
list
- A list where the Parcelable objects at the current data position will be added.clazz
- The object type required for each item.- Returns:
A newly created List containing objects with the same data as those that were previously written.
-
readSupportParcelable
final static <T extends Parcelable> T readSupportParcelable(Parcel $self, ClassLoader classLoader, Class<T> clazz)
Reads a new Parcelable from the parcel. The given class loader will be used to load any enclosed Parcelables. If it is
<p><b>Note: </b> This method will use the latest APIs introduced with [Build.VERSION_CODES#TIRAMISU], and will fall back on the older APIs on previous versions.null
, the default class loader will be used.- Parameters:
classLoader
- A ClassLoader from which to instantiate the Parcelable object, or null for the default class loader.clazz
- The object type required for each item.- Returns:
The newly created Parcelable, or null if a null object has been written.
-
-
-
-