public final class

NavType.EnumType<D extends java.lang.Enum>

extends NavType.SerializableType<java.lang.Enum>

 java.lang.Object

androidx.navigation.NavType<java.io.Serializable>

androidx.navigation.NavType.SerializableType<java.lang.Enum>

↳androidx.navigation.NavType.EnumType<D>

Overview

EnumType is used for NavArguments 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

Fields
from NavType<T>BoolArrayType, BoolType, FloatArrayType, FloatType, IntArrayType, IntType, LongArrayType, LongType, ReferenceType, StringArrayType, StringType
Constructors
publicEnumType(java.lang.Class<java.lang.Enum> type)

Constructs a NavType that supports a given Enum type.

Methods
public abstract java.lang.StringgetName()

Returns the name of this type.

public abstract java.lang.ObjectparseValue(java.lang.String value)

Parse a value of this type from a String.

from NavType.SerializableType<D>equals, get, hashCode, put
from NavType<T>fromArgType, isNullableAllowed, put, toString
from java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructors

public EnumType(java.lang.Class<java.lang.Enum> type)

Constructs a NavType that supports a given Enum type.

Parameters:

type: class that is an Enum

Methods

public abstract java.lang.Object parseValue(java.lang.String value)

Parse a value of this type from a String.

Parameters:

value: string representation of a value of this type

Returns:

parsed value of the type represented by this NavType

public abstract java.lang.String getName()

Returns the name of this type.

This is the same value that is used in Navigation XML argType attribute.

Returns:

name of this type