MutableBoundKernelParameter

class MutableBoundKernelParameter<T : Any>(parameter: KernelParameter<T>, val valueUpdater: (T?) -> Unit, val valueProvider: () -> T?) : BoundKernelParameter<T>

Class that extends BoundKernelParameter with the ability to update the parameter value. This allows for both parsing and serializing parameter values.

Parameters

T

The type of value that this parameter represents

Constructors

Link copied to clipboard
constructor(parameter: KernelParameter<T>, property: KMutableProperty0<T?>)

Convenience constructor that uses a mutable property for both value updating and providing.

constructor(parameter: KernelParameter<T>, valueUpdater: (T?) -> Unit, valueProvider: () -> T?)

Properties

Link copied to clipboard

The parameter handler to use for serialization

Link copied to clipboard
open override val valueProvider: () -> T?

Function that provides the current value of the parameter

Link copied to clipboard
val valueUpdater: (T?) -> Unit

Function that updates the stored value of the parameter

Functions

Link copied to clipboard
fun serialize(argsBuilder: MutableList<String>)

Serializes the current parameter value and adds it to the argument list. If the value is null or the parameter handler returns null, nothing is added.

Link copied to clipboard

Attempts to parse a command-line argument and update the parameter value if successful.