NavType.ParcelableArrayType
public final class NavType.ParcelableArrayType<D extends Parcelable> extends NavType
ParcelableArrayType is used for NavArguments which hold arrays of Parcelables.
Null values are supported. Default values in Navigation XML files are not supported.
Summary
Public constructors |
|---|
<D extends Parcelable> ParcelableArrayType(@NonNull Class<@NonNull D> type) |
Public methods |
|
|---|---|
boolean |
|
D[] |
Get a value of this type from the |
@NonNull String |
getName()The name of this type. |
int |
hashCode() |
@NonNull D[] |
parseValue(@NonNull String value) |
void |
Put a value of this type in the |
boolean |
valueEquals(D[] value, D[] other)Compares two values of type |
Inherited methods |
||||||||
|---|---|---|---|---|---|---|---|---|
|
Public constructors
ParcelableArrayType
public <D extends Parcelable> ParcelableArrayType(@NonNull Class<@NonNull D> type)
Public methods
get
public D[] get(@NonNull Bundle bundle, @NonNull String key)
Get a value of this type from the savedState
| Returns | |
|---|---|
D[] |
value of this type |
getName
public @NonNull String getName()
The name of this type.
This is the same value that is used in Navigation XML argType attribute.
parseValue
public @NonNull D[] parseValue(@NonNull String value)
| Throws | |
|---|---|
UnsupportedOperationException |
since Arrays do not support default values |
put
public void put(@NonNull Bundle bundle, @NonNull String key, D[] value)
Put a value of this type in the savedState
valueEquals
public boolean valueEquals(D[] value, D[] other)
Compares two values of type T and returns true if values are equal.
| Parameters | |
|---|---|
D[] value |
the first value for comparison |
D[] other |
the second value for comparison |