NavType.SerializableType
public class NavType.SerializableType<D extends Serializable> extends NavType
NavType.EnumType |
EnumType is used for |
SerializableType is used for Serializable NavArguments. For handling Enums you must use EnumType instead.
Null values are supported. Default values in Navigation XML files are not supported.
| See also | |
|---|---|
NavType.EnumType |
Summary
Public constructors |
|---|
<D extends Serializable> SerializableType(@NonNull Class<@NonNull D> type)Constructs a NavType that supports a given Serializable 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 |
Inherited methods |
||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
SerializableType
public <D extends Serializable> SerializableType(@NonNull Class<@NonNull D> type)
Constructs a NavType that supports a given Serializable 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 Serializables do not support default values |