Sequenceablepublic class IntentParams extends Object implements Sequenceable
Ability.
Parameter information in IntentParams is saved in the form of key-value pairs. The keys are of the String
type, and the values are saved as objects of the Object type. You can use the
setParam(java.lang.String,java.lang.Object) method to set parameters.
SystemCapability.Aafwk#INTENTSequenceable.Producer<T>| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static Sequenceable.Producer<IntentParams> |
PRODUCER |
Creates a
IntentParams instance from a Parcel. |
| 构造器 | 说明 |
|---|---|
IntentParams() |
A constructor used to create an empty
IntentParams instance. |
IntentParams(IntentParams intentParams) |
A constructor used to create an
IntentParams instance by using the parameters of an existing
IntentParams object. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
ClassLoader |
getClassLoader() |
Obtains the
ClassLoader used for the custom parameters of the Sequenceable type. |
Object |
getParam(String key) |
Obtains the parameter value based on a given key.
|
boolean |
hasParam(String key) |
Checks whether the
Intent contains the given key. |
boolean |
isEmpty() |
Checks whether this
IntentParams object contains no parameters. |
Set<String> |
keySet() |
Obtains a set of the keys of all parameters.
|
boolean |
marshalling(Parcel out) |
Marshals an
IntentParams object into a Parcel. |
void |
remove(String key) |
Removes the parameter matching the given key.
|
void |
setClassLoader(ClassLoader classLoader) |
Sets the
ClassLoader used for the custom parameters of the Sequenceable type. |
<T> void |
setParam(String key,
T value) |
Sets a parameter in key-value pair format.
|
int |
size() |
Obtains the number of parameters contained in this
IntentParams object. |
boolean |
unmarshalling(Parcel in) |
Unmarshals an
IntentParams object from a Parcel. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasFileDescriptorpublic static final Sequenceable.Producer<IntentParams> PRODUCER
IntentParams instance from a Parcel.public IntentParams()
IntentParams instance.public IntentParams(IntentParams intentParams)
IntentParams instance by using the parameters of an existing
IntentParams object.intentParams - Indicates the existing IntentParams object.public ClassLoader getClassLoader()
ClassLoader used for the custom parameters of the Sequenceable type.ClassLoader object used.public void setClassLoader(ClassLoader classLoader)
ClassLoader used for the custom parameters of the Sequenceable type.
You should call this method before setting custom parameters of the Sequenceable type
in an Intent.
classLoader - Indicates the ClassLoader object to set.Intent.setParam(String, Sequenceable),
Intent.setParam(String, Sequenceable[]),
Intent.setSequenceableArrayListParam(String, ArrayList)public boolean marshalling(Parcel out)
IntentParams object into a Parcel.
Key-value pairs in the IntentParams are marshalled separately. If any key-value pair fails to be
marshalled, false is returned.
marshalling 在接口中 Sequenceableout - Indicates the Parcel object for marshalling.true if the marshalling is successful; returns false otherwise.IllegalArgumentException - Throws this exception if a parameter value is invalid.public boolean unmarshalling(Parcel in)
IntentParams object from a Parcel.
Key-value pairs in the IntentParams are unmarshalled separately. If any key-value pair fails to be
unmarshalled, false is returned.
unmarshalling 在接口中 Sequenceablein - Indicates the Parcel object for unmarshalling.true if the unmarshalling is successful; returns false otherwise.IllegalArgumentException - Throws this exception if a parameter value is invalid.public <T> void setParam(String key, T value)
T - Indicates the data type of the parameter value. It must be a child class of Object.key - Indicates the key matching the parameter.value - Indicates the value of the parameter.public boolean isEmpty()
IntentParams object contains no parameters.true if this object does not contain any parameters; returns false otherwise.public int size()
IntentParams object.public void remove(String key)
key - Indicates the key matching the parameter to be removed.public Object getParam(String key)
key - Indicates the key matching the parameter.public boolean hasParam(String key)
Intent contains the given key.key - Indicates the key to check.true if the Intent contains the key; returns false otherwise.