NavType.SerializableArrayType
public final class NavType.SerializableArrayType<D extends Serializable> extends NavType
SerializableArrayType is used for NavArguments that hold arrays of Serializables. This type also supports arrays of Enums.
Null values are supported. Default values in Navigation XML files are not supported.
Summary
Public constructors |
|---|
<D extends Serializable> SerializableArrayType(@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
SerializableArrayType
public <D extends Serializable> SerializableArrayType(@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 |