Module dev.metaschema.cli.processor
Class DefaultExtraArgument
java.lang.Object
dev.metaschema.cli.processor.command.impl.DefaultExtraArgument
- All Implemented Interfaces:
ExtraArgument
A default implementation of the
ExtraArgument interface that
represents a named command-line argument which can be marked as required or
optional.
This implementation is used by the command processor to handle additional arguments that are not covered by specific command options.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultExtraArgument(String name, boolean required) Construct a new instance.DefaultExtraArgument(String name, boolean required, Class<?> type) Construct a new instance with type information for shell completion. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.metaschema.cli.processor.command.ExtraArgument
getNumber
-
Constructor Details
-
DefaultExtraArgument
Construct a new instance.- Parameters:
name- the argument namerequired-trueif the argument is required, orfalseotherwise
-
DefaultExtraArgument
Construct a new instance with type information for shell completion.- Parameters:
name- the argument namerequired-trueif the argument is required, orfalseotherwisetype- the type class for completion lookup, ornullfor freeform input
-
-
Method Details
-
getName
Description copied from interface:ExtraArgumentGet the argument name.- Specified by:
getNamein interfaceExtraArgument- Returns:
- the name
-
isRequired
public boolean isRequired()Description copied from interface:ExtraArgumentGet if the argument is required.- Specified by:
isRequiredin interfaceExtraArgument- Returns:
trueif the argument is required, orfalseotherwise
-
getType
Description copied from interface:ExtraArgumentGet the type for shell completion purposes.The type is used by
CompletionTypeRegistryto lookup the appropriate completion behavior for this argument.- Specified by:
getTypein interfaceExtraArgument- Returns:
- the type class used to determine shell completion behavior, or
nullfor freeform input
-