Class BooleanValueHandler
java.lang.Object
org.tquadrat.foundation.config.cli.CmdLineValueHandler<Boolean>
org.tquadrat.foundation.config.cli.BooleanValueHandler
@ClassVersion(sourceVersion="$Id: BooleanValueHandler.java 1061 2023-09-25 16:32:43Z tquadrat $")
@API(status=STABLE,
since="0.0.1")
public class BooleanValueHandler
extends CmdLineValueHandler<Boolean>
- Author:
- Kohsuke Kawaguchi (kk@kohsuke.org)
- Modified by:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: BooleanValueHandler.java 1061 2023-09-25 16:32:43Z tquadrat $
- Since:
- 0.0.1
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.config.cli.BooleanValueHandler"
-
Field Summary
Fields inherited from class org.tquadrat.foundation.config.cli.CmdLineValueHandler
DEFAULT_PROPERTY_NAME, MSG_InvalidParameter, MSGKEY_InvalidParameter -
Constructor Summary
ConstructorsConstructorDescriptionBooleanValueHandler(BiConsumer<String, Boolean> valueSetter) Creates a newBooleanValueHandlerinstance.BooleanValueHandler(CLIDefinition context, BiConsumer<String, Boolean> valueSetter) Creates a newBooleanValueHandlerinstance. -
Method Summary
Modifier and TypeMethodDescriptionintparseCmdLine(Parameters params) Parses the given command line snippet and stores the result to the property.protected Collection<Boolean> translate(Parameters params) Translates the command line values that can be referenced via theparamsargument to the target type.Methods inherited from class org.tquadrat.foundation.config.cli.CmdLineValueHandler
getCLIDefinition, getPropertyName, getValueSetter, setContext
-
Constructor Details
-
BooleanValueHandler
Creates a newBooleanValueHandlerinstance.- Parameters:
context- The CLI definition that provides the context for this value handler.valueSetter- The function that places the translated value to the property.
-
BooleanValueHandler
Creates a newBooleanValueHandlerinstance.- Parameters:
valueSetter- The function that places the translated value to the property.
-
-
Method Details
-
parseCmdLine
Parses the given command line snippet and stores the result to the property.- Overrides:
parseCmdLinein classCmdLineValueHandler<Boolean>- Parameters:
params- The command line values to parse.- Returns:
- The number of values that the method took from the command line.
-
translate
Translates the command line values that can be referenced via theparamsargument to the target type.- Specified by:
translatein classCmdLineValueHandler<Boolean>- Parameters:
params- The command line values to translate.- Returns:
- A collection with the result; each entry in the collection corresponds to one value from the command line.
- Throws:
CmdLineException- The given parameters cannot be parsed to the target type.
-
