NavArgumentBuilder


@NavDestinationDsl
public final class NavArgumentBuilder


DSL for constructing a new NavArgument

Summary

Public constructors

Public methods

final @NonNull NavArgument

Builds the NavArgument by calling NavArgument.Builder.build.

final Object

An optional default value for this argument.

final boolean

Controls if this argument allows null values.

final @NonNull NavType<@NonNull ?>

The NavType for this argument.

final void
setDefaultValue(Object defaultValue)

An optional default value for this argument.

final void
setNullable(boolean nullable)

Controls if this argument allows null values.

final void

The NavType for this argument.

Public constructors

Added in 1.0.0
public NavArgumentBuilder()

Public methods

build

Added in 1.0.0
public final @NonNull NavArgument build()

Builds the NavArgument by calling NavArgument.Builder.build.

getDefaultValue

Added in 1.0.0
public final Object getDefaultValue()

An optional default value for this argument.

Any object that you set here must be compatible with type, if it was specified.

getNullable

Added in 1.0.0
public final boolean getNullable()

Controls if this argument allows null values.

getType

Added in 1.0.0
public final @NonNull NavType<@NonNull ?> getType()

The NavType for this argument.

If you don't set a type explicitly, it will be inferred from the default value of this argument.

setDefaultValue

Added in 1.0.0
public final void setDefaultValue(Object defaultValue)

An optional default value for this argument.

Any object that you set here must be compatible with type, if it was specified.

setNullable

Added in 1.0.0
public final void setNullable(boolean nullable)

Controls if this argument allows null values.

setType

Added in 1.0.0
public final void setType(@NonNull NavType<@NonNull ?> type)

The NavType for this argument.

If you don't set a type explicitly, it will be inferred from the default value of this argument.