CollectionNavType
public abstract class CollectionNavType<T extends Object> extends NavType
A NavType for Collection such as arrays, lists, maps.
| Parameters | |
|---|---|
<T extends Object> |
the type of the data that is supported by this NavType |
Summary
Public constructors |
|---|
<T extends Object> CollectionNavType(boolean isNullableAllowed) |
Public methods |
|
|---|---|
abstract @NonNull T |
Create and return an empty collection of type |
abstract @NonNull List<@NonNull String> |
serializeAsValues(@NonNull T value)Serialize a value of this NavType into a list of String. |
Inherited methods |
||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
CollectionNavType
public <T extends Object> CollectionNavType(boolean isNullableAllowed)
| Parameters | |
|---|---|
<T extends Object> |
the type of the data that is supported by this NavType |
boolean isNullableAllowed |
whether the argument of this type can hold a null value |
Public methods
emptyCollection
public abstract @NonNull T emptyCollection()
Create and return an empty collection of type T
For example, T of type List
serializeAsValues
public abstract @NonNull List<@NonNull String> serializeAsValues(@NonNull T value)
Serialize a value of this NavType into a list of String.
Each element in the collection should be converted to an individual String element of the returned list.
Note: Elements should be encoded with Uri.encode
| Parameters | |
|---|---|
@NonNull T value |
a value of this NavType |