Package org.pkl.core
Record Class CommandSpec.Argument
java.lang.Object
java.lang.Record
org.pkl.core.CommandSpec.Argument
- All Implemented Interfaces:
CommandSpec.Option
- Enclosing class:
CommandSpec
public static record CommandSpec.Argument(String name, @Nullable String helpText, BiFunction<String,URI,Object> transformEach, BiFunction<List<Object>,URI,Object> transformAll, @Nullable CommandSpec.CompletionCandidates completionCandidates, boolean repeated)
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
ConstructorsConstructorDescriptionArgument(String name, @Nullable String helpText, BiFunction<String, URI, Object> transformEach, BiFunction<List<Object>, URI, Object> transformAll, @Nullable CommandSpec.CompletionCandidates completionCandidates, boolean repeated) Creates an instance of aArgumentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecompletionCandidatesrecord 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.name()Returns the value of thenamerecord component.booleanrepeated()Returns the value of therepeatedrecord 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
-
Argument
public Argument(String name, @Nullable @Nullable String helpText, BiFunction<String, URI, Object> transformEach, BiFunction<List<Object>, URI, Object> transformAll, @Nullable @Nullable CommandSpec.CompletionCandidates completionCandidates, boolean repeated) Creates an instance of aArgumentrecord class.- Parameters:
name- the value for thenamerecord componenthelpText- the value for thehelpTextrecord componenttransformEach- the value for thetransformEachrecord componenttransformAll- the value for thetransformAllrecord componentcompletionCandidates- the value for thecompletionCandidatesrecord componentrepeated- the value for therepeatedrecord 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
-
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
-
repeated
public boolean repeated()Returns the value of therepeatedrecord component.- Returns:
- the value of the
repeatedrecord component
-