NavType.EnumType



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

Public constructors

<D : Enum<*>> EnumType(type: Class<D>)
android

Public functions

open D

Parse a value of this type from a String.

android

Public properties

open String
android

Inherited functions

From androidx.navigation.NavType
open D
parseValue(value: String, previousValue: D)
android
open String
serializeAsValue(value: D)
android
open String
android
open Boolean
valueEquals(value: D, other: D)
android
From androidx.navigation.NavType.SerializableType
open operator Boolean
equals(other: Any?)
android
open operator D?
get(bundle: Bundle, key: String)
android
open Int
android
open Unit
put(bundle: Bundle, key: String, value: D)
android

Inherited properties

From androidx.navigation.NavType
open Boolean
android

Public constructors

EnumType

<D : Enum<*>> EnumType(type: Class<D>)
Parameters
type: Class<D>

the Enum class that is supported by this NavType

Public functions

parseValue

open fun parseValue(value: String): D

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

Throws
kotlin.IllegalArgumentException

if value cannot be parsed into this type

Public properties

name

open val nameString