NavType.Companion

object NavType.Companion


Summary

Public fields

final @NonNull NavType<@NonNull boolean[]>

NavType for storing boolean arrays, corresponding with the "boolean[]" type in a Navigation XML file.

final @NonNull NavType<@NonNull Boolean>

NavType for storing boolean values, corresponding with the "boolean" type in a Navigation XML file.

final @NonNull NavType<@NonNull float[]>

NavType for storing float arrays, corresponding with the "float[]" type in a Navigation XML file.

final @NonNull NavType<@NonNull Float>

NavType for storing float values, corresponding with the "float" type in a Navigation XML file.

final @NonNull NavType<@NonNull int[]>

NavType for storing integer arrays, corresponding with the "integer[]" type in a Navigation XML file.

final @NonNull NavType<@NonNull Integer>

NavType for storing integer values, corresponding with the "integer" type in a Navigation XML file.

final @NonNull NavType<@NonNull long[]>

NavType for storing long arrays, corresponding with the "long[]" type in a Navigation XML file.

final @NonNull NavType<@NonNull Long>

NavType for storing long values, corresponding with the "long" type in a Navigation XML file.

final @NonNull NavType<@NonNull Integer>

NavType for storing integer values representing resource ids, corresponding with the "reference" type in a Navigation XML file.

final @NonNull NavType<@NonNull Array<@NonNull String>>

NavType for storing String arrays, corresponding with the "string[]" type in a Navigation XML file.

final @NonNull NavType<@NonNull String>

NavType for storing String values, corresponding with the "string" type in a Navigation XML file.

Public methods

@NonNull NavType<@NonNull ?>
fromArgType(@Nullable String type, @Nullable String packageName)

Parse an argType string into a NavType.

Public fields

BoolArrayType

@NonNull
public final @NonNull NavType<@NonNull boolean[]> BoolArrayType

NavType for storing boolean arrays, corresponding with the "boolean[]" type in a Navigation XML file.

Null values are supported. Default values in Navigation XML files are not supported.

BoolType

@NonNull
public final @NonNull NavType<@NonNull BooleanBoolType

NavType for storing boolean values, corresponding with the "boolean" type in a Navigation XML file.

Null values are not supported.

FloatArrayType

@NonNull
public final @NonNull NavType<@NonNull float[]> FloatArrayType

NavType for storing float arrays, corresponding with the "float[]" type in a Navigation XML file.

Null values are supported. Default values in Navigation XML files are not supported.

FloatType

@NonNull
public final @NonNull NavType<@NonNull FloatFloatType

NavType for storing float values, corresponding with the "float" type in a Navigation XML file.

Null values are not supported.

IntArrayType

@NonNull
public final @NonNull NavType<@NonNull int[]> IntArrayType

NavType for storing integer arrays, corresponding with the "integer[]" type in a Navigation XML file.

Null values are supported. Default values in Navigation XML files are not supported.

IntType

@NonNull
public final @NonNull NavType<@NonNull IntegerIntType

NavType for storing integer values, corresponding with the "integer" type in a Navigation XML file.

Null values are not supported.

LongArrayType

@NonNull
public final @NonNull NavType<@NonNull long[]> LongArrayType

NavType for storing long arrays, corresponding with the "long[]" type in a Navigation XML file.

Null values are supported. Default values in Navigation XML files are not supported.

LongType

@NonNull
public final @NonNull NavType<@NonNull LongLongType

NavType for storing long values, corresponding with the "long" type in a Navigation XML file.

Null values are not supported. Default values for this type in Navigation XML files must always end with an 'L' suffix, e.g. app:defaultValue="123L".

ReferenceType

@NonNull
public final @NonNull NavType<@NonNull IntegerReferenceType

NavType for storing integer values representing resource ids, corresponding with the "reference" type in a Navigation XML file.

Null values are not supported.

StringArrayType

@NonNull
public final @NonNull NavType<@NonNull Array<@NonNull String>> StringArrayType

NavType for storing String arrays, corresponding with the "string[]" type in a Navigation XML file.

Null values are supported. Default values in Navigation XML files are not supported.

StringType

@NonNull
public final @NonNull NavType<@NonNull StringStringType

NavType for storing String values, corresponding with the "string" type in a Navigation XML file.

Null values are supported.

Public methods

fromArgType

@NonNull
public NavType<@NonNull ?> fromArgType(@Nullable String type, @Nullable String packageName)

Parse an argType string into a NavType.

Parameters
@Nullable String type

argType string, usually parsed from the Navigation XML file

@Nullable String packageName

package name of the R file, used for parsing relative class names starting with a dot.

Returns
NavType<@NonNull ?>

a NavType representing the type indicated by the argType string. Defaults to StringType for null.

Throws
kotlin.IllegalArgumentException

if there is no valid argType

kotlin.RuntimeException

if the type class name cannot be found