Package org.pkl.core
Record Class CommandSpec
java.lang.Object
java.lang.Record
org.pkl.core.CommandSpec
public record CommandSpec(String name, @Nullable String helpText, boolean hidden, boolean noOp, Iterable<CommandSpec.Option> options, List<CommandSpec> subcommands, CommandSpec.ApplyFunction apply)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final recordstatic final recordstatic classstatic final recordstatic final recordstatic interfacestatic final recordstatic final record -
Constructor Summary
ConstructorsConstructorDescriptionCommandSpec(String name, @Nullable String helpText, boolean hidden, boolean noOp, Iterable<CommandSpec.Option> options, List<CommandSpec> subcommands, CommandSpec.ApplyFunction apply) Creates an instance of aCommandSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionapply()Returns the value of theapplyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.helpText()Returns the value of thehelpTextrecord component.booleanhidden()Returns the value of thehiddenrecord component.name()Returns the value of thenamerecord component.booleannoOp()Returns the value of thenoOprecord component.options()Returns the value of theoptionsrecord component.Returns the value of thesubcommandsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CommandSpec
public CommandSpec(String name, @Nullable @Nullable String helpText, boolean hidden, boolean noOp, Iterable<CommandSpec.Option> options, List<CommandSpec> subcommands, CommandSpec.ApplyFunction apply) Creates an instance of aCommandSpecrecord class.- Parameters:
name- the value for thenamerecord componenthelpText- the value for thehelpTextrecord componenthidden- the value for thehiddenrecord componentnoOp- the value for thenoOprecord componentoptions- the value for theoptionsrecord componentsubcommands- the value for thesubcommandsrecord componentapply- the value for theapplyrecord component
-
-
Method Details
-
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.- Returns:
- the value of the
namerecord component
-
helpText
Returns the value of thehelpTextrecord component.- Returns:
- the value of the
helpTextrecord component
-
noOp
public boolean noOp()Returns the value of thenoOprecord component.- Returns:
- the value of the
noOprecord component
-
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-
subcommands
Returns the value of thesubcommandsrecord component.- Returns:
- the value of the
subcommandsrecord component
-
apply
Returns the value of theapplyrecord component.- Returns:
- the value of the
applyrecord component
-