Package org.pkl.core
Record Class CommandSpec.Flag
java.lang.Object
java.lang.Record
org.pkl.core.CommandSpec.Flag
- All Implemented Interfaces:
CommandSpec.Option
- Enclosing class:
CommandSpec
public static record CommandSpec.Flag(String name, @Nullable String helpText, boolean showAsRequired, BiFunction<String,URI,Object> transformEach, BiFunction<List<Object>,URI,Object> transformAll, @Nullable CommandSpec.CompletionCandidates completionCandidates, @Nullable String shortName, String metavar, boolean hidden, @Nullable String defaultValue)
extends Record
implements CommandSpec.Option
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.pkl.core.CommandSpec.Option
CommandSpec.Option.BadValue, CommandSpec.Option.MissingOption -
Constructor Summary
ConstructorsConstructorDescriptionFlag(String name, @Nullable String helpText, boolean showAsRequired, BiFunction<String, URI, Object> transformEach, BiFunction<List<Object>, URI, Object> transformAll, @Nullable CommandSpec.CompletionCandidates completionCandidates, @Nullable String shortName, String metavar, boolean hidden, @Nullable String defaultValue) Creates an instance of aFlagrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecompletionCandidatesrecord component.Returns the value of thedefaultValuerecord component.final booleanIndicates whether some other object is "equal to" this one.String[]getNames()final inthashCode()Returns a hash code value for this object.helpText()Returns the value of thehelpTextrecord component.booleanhidden()Returns the value of thehiddenrecord component.metavar()Returns the value of themetavarrecord component.name()Returns the value of thenamerecord component.Returns the value of theshortNamerecord component.booleanReturns the value of theshowAsRequiredrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetransformAllrecord component.Returns the value of thetransformEachrecord component.
-
Constructor Details
-
Flag
public Flag(String name, @Nullable @Nullable String helpText, boolean showAsRequired, BiFunction<String, URI, Object> transformEach, BiFunction<List<Object>, URI, Object> transformAll, @Nullable @Nullable CommandSpec.CompletionCandidates completionCandidates, @Nullable @Nullable String shortName, String metavar, boolean hidden, @Nullable @Nullable String defaultValue) Creates an instance of aFlagrecord class.- Parameters:
name- the value for thenamerecord componenthelpText- the value for thehelpTextrecord componentshowAsRequired- the value for theshowAsRequiredrecord componenttransformEach- the value for thetransformEachrecord componenttransformAll- the value for thetransformAllrecord componentcompletionCandidates- the value for thecompletionCandidatesrecord componentshortName- the value for theshortNamerecord componentmetavar- the value for themetavarrecord componenthidden- the value for thehiddenrecord componentdefaultValue- the value for thedefaultValuerecord component
-
-
Method Details
-
getNames
- Specified by:
getNamesin interfaceCommandSpec.Option
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Specified by:
namein interfaceCommandSpec.Option- Returns:
- the value of the
namerecord component
-
helpText
Returns the value of thehelpTextrecord component.- Returns:
- the value of the
helpTextrecord component
-
showAsRequired
public boolean showAsRequired()Returns the value of theshowAsRequiredrecord component.- Returns:
- the value of the
showAsRequiredrecord component
-
transformEach
Returns the value of thetransformEachrecord component.- Returns:
- the value of the
transformEachrecord component
-
transformAll
Returns the value of thetransformAllrecord component.- Returns:
- the value of the
transformAllrecord component
-
completionCandidates
Returns the value of thecompletionCandidatesrecord component.- Returns:
- the value of the
completionCandidatesrecord component
-
shortName
Returns the value of theshortNamerecord component.- Returns:
- the value of the
shortNamerecord component
-
metavar
Returns the value of themetavarrecord component.- Returns:
- the value of the
metavarrecord component
-
defaultValue
Returns the value of thedefaultValuerecord component.- Returns:
- the value of the
defaultValuerecord component
-