SimpleNamedKernelParameter

abstract class SimpleNamedKernelParameter<T : Any>(val name: String, valueParser: (String, T?) -> T, valueSerializer: (T) -> String = { it.toString() }) : NamedKernelParameter<T>

Inheritors

Constructors

Link copied to clipboard
constructor(name: String, valueParser: (String, T?) -> T, valueSerializer: (T) -> String = { it.toString() })

Properties

Link copied to clipboard

List of alternative names for this parameter

Link copied to clipboard

Functions

Link copied to clipboard
open override fun parseValue(argValue: String, previousValue: T?): T

Parses a string value into a value of type T. This method is called after the parameter name has been matched and the value extracted.

Link copied to clipboard
open override fun serialize(value: T): String?

Serializes a value to a command-line argument with the parameter's primary alias.

Link copied to clipboard
open override fun serializeValue(value: T): String

Serializes a value of type T to a string representation (without the parameter name prefix).

Link copied to clipboard
open override fun tryParse(arg: String, previousValue: T?): T?

Attempts to parse a command-line argument if it matches one of this parameter's aliases. Checks if the argument starts with "-alias=" for any of the aliases.