toDefaulting

open fun toDefaulting(defaultValue: T, outputError: Boolean = false, signatureType: Key? = null, showTypeInSignature: Boolean? = null, errorType: Key? = null, nestedValidator: Validator<T> = null): DefaultingCoalescingConverter<T>

Wrap this coalescing converter with a CoalescingToDefaultingConverter, which is a special converter that will act like an DefaultingCoalescingConverter using the same logic of this converter.

Your converter should be designed with this pattern in mind. If that's not possible, please override this function and throw an exception in the body.

For more information on the parameters, see Converter.

Parameters

defaultValue

The default value to use when an argument can't be converted.

outputError

Whether the argument parser should output parsing errors on invalid arguments.

signatureTypeString

Optionally, a signature type string to use instead of the one this converter provides.

showTypeInSignature

Optionally, override this converter's setting for showing the type string in a generated command signature.

errorTypeString

Optionally, a longer type string to be shown in errors instead of the one this converter provides.