NavType.EnumType
public
static
final
class
NavType.EnumType
extends SerializableType<D extends Enum>
EnumType is used for NavArgument
s holding enum values.
Null values are not supported.
To specify a default value in a Navigation XML file, simply use the enum constant
without the class name, e.g. `app:defaultValue="MONDAY"`.
Summary
Inherited fields |
From class
androidx.navigation.NavType
public
static
final
NavType<boolean[]> |
BoolArrayType
NavType for storing boolean arrays,
corresponding with the "boolean[]" type in a Navigation XML file.
|
public
static
final
NavType<Boolean> |
BoolType
NavType for storing boolean values,
corresponding with the "boolean" type in a Navigation XML file.
|
public
static
final
NavType<float[]> |
FloatArrayType
NavType for storing float arrays,
corresponding with the "float[]" type in a Navigation XML file.
|
public
static
final
NavType<Float> |
FloatType
NavType for storing float values,
corresponding with the "float" type in a Navigation XML file.
|
public
static
final
NavType<int[]> |
IntArrayType
NavType for storing integer arrays,
corresponding with the "integer[]" type in a Navigation XML file.
|
public
static
final
NavType<Integer> |
IntType
NavType for storing integer values,
corresponding with the "integer" type in a Navigation XML file.
|
public
static
final
NavType<long[]> |
LongArrayType
NavType for storing long arrays,
corresponding with the "long[]" type in a Navigation XML file.
|
public
static
final
NavType<Long> |
LongType
NavType for storing long values,
corresponding with the "long" type in a Navigation XML file.
|
public
static
final
NavType<Integer> |
ReferenceType
NavType for storing integer values representing resource ids,
corresponding with the "reference" type in a Navigation XML file.
|
public
static
final
NavType<String[]> |
StringArrayType
NavType for storing String arrays,
corresponding with the "string[]" type in a Navigation XML file.
|
public
static
final
NavType<String> |
StringType
NavType for storing String values,
corresponding with the "string" type in a Navigation XML file.
|
|
Public constructors |
EnumType(Class<D> type)
Constructs a NavType that supports a given Enum type.
|
Public methods |
String
|
getName()
Returns the name of this type.
|
D
|
parseValue(String value)
Parse a value of this type from a String.
|
Inherited methods |
|
From class
androidx.navigation.NavType
static
NavType<?>
|
fromArgType(String type, String packageName)
Parse an argType string into a NavType.
|
abstract
D extends Serializable
|
get(Bundle bundle, String key)
Get a value of this type from the bundle
|
abstract
String
|
getName()
Returns the name of this type.
|
boolean
|
isNullableAllowed()
Check if an argument with this type can hold a null value.
|
abstract
D extends Serializable
|
parseValue(String value)
Parse a value of this type from a String.
|
abstract
void
|
put(Bundle bundle, String key, D value)
Put a value of this type in he bundle
|
String
|
toString()
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
EnumType
public EnumType (Class<D> type)
Constructs a NavType that supports a given Enum type.
Parameters |
type |
Class : class that is an Enum
|
Public methods
getName
public String getName ()
Returns the name of this type.
This is the same value that is used in Navigation XML argType
attribute.
Returns |
String |
name of this type
|
parseValue
public D parseValue (String value)
Parse a value of this type from a String.
Parameters |
value |
String : string representation of a value of this type |
Returns |
D |
parsed value of the type represented by this NavType |