public class CommandArgIterator extends Object
| Constructor and Description |
|---|
CommandArgIterator(Iterator<String> argsIt,
Set<String> commonArgumentsAndHighLevelCommandSet) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNextArg() |
boolean |
hasNextSubArg() |
static boolean |
isCommandOrOption(String raw)
Check if raw arg is command or option.
|
String |
nextArg(String err)
Extract next argument.
|
@NotNull String |
nextArgValue(String argName)
Extract next non command argument value
|
byte |
nextByteArg(String argName) |
@NotNull Set<String> |
nextCacheGroupsSet(String cachesGroupsArgName) |
@NotNull Set<String> |
nextCachesSet(String cachesArgName) |
@NotNull Set<String> |
nextCachesSet0(String cachesArgName,
boolean groups)
Parses next value as set of caches names
|
<E extends Enum<E> & CommandArg> |
nextCmdArgOrFail(Class<E> type,
String argName)
Parse next argument as specified
CommandArg Enum value |
<E extends Enum<E>> |
nextEnumOrFail(Class<E> type,
String argName)
Parse next argument as specified Enum value
|
int |
nextIntArg(String argName) |
long |
nextLongArg(String argName) |
Set<String> |
nextNonEmptyStringSet(String expectedValDescr) |
int |
nextNonNegativeIntArg(String argName) |
long |
nextNonNegativeLongArg(String argName) |
Set<String> |
nextStringSet(String expectedValDescr) |
Set<String> |
nextStringSet0(String expectedValDescr,
boolean requireNonEmpty) |
@NotNull String |
nextToken(String errOnNoData,
Function<String,String> unexpectedDataErrMapper)
Extract next Non Auto Confirmation argument
|
UUID |
nextUuidArg(String argName) |
@NotNull Set<String> |
parseStringSet(String string) |
String |
peekNextArg()
Returns the next argument in the iteration, without advancing the iteration.
|
public boolean hasNextArg()
true if the iteration has more elements.public boolean hasNextSubArg()
true if there's next argument for subcommand.public String nextArg(String err)
err - Error message.@NotNull public @NotNull String nextArgValue(String argName)
argName - Name of argument, which values we're trying to extract.@NotNull public @NotNull String nextToken(String errOnNoData, Function<String,String> unexpectedDataErrMapper)
errOnNoData - Message for error when not enough data to parse.unexpectedDataErrMapper - Mapper that must provide error message based on unexpected input value.@NotNull public <E extends Enum<E> & CommandArg> E nextCmdArgOrFail(Class<E> type, String argName)
CommandArg Enum valuetype - CommandArg Enum class.argName - Name of argument, which values we're trying to convert to Enum.IllegalArgumentException - if no suitable Enum value found@NotNull public <E extends Enum<E>> E nextEnumOrFail(Class<E> type, String argName)
type - Enum class.argName - Name of argument, which values we're trying to convert to Enum.IllegalArgumentException - if no suitable Enum value foundpublic String peekNextArg()
null if no next argument.public long nextNonNegativeLongArg(String argName)
public int nextNonNegativeIntArg(String argName)
public long nextLongArg(String argName)
public int nextIntArg(String argName)
public byte nextByteArg(String argName)
public Set<String> nextStringSet(String expectedValDescr)
expectedValDescr - description of expected data.Collections.emptySet() if next argument is an optionpublic Set<String> nextNonEmptyStringSet(String expectedValDescr)
nextStringSet0(String, boolean)public Set<String> nextStringSet0(String expectedValDescr, boolean requireNonEmpty)
expectedValDescr - description of expected data.requireNonEmpty - True if exception must be thrown on empty set@NotNull public @NotNull Set<String> parseStringSet(String string)
string - To scan on for string set.@NotNull public @NotNull Set<String> nextCachesSet0(String cachesArgName, boolean groups)
cachesArgName - Name of argumentgroups - True if we're parsing cache group names@NotNull public @NotNull Set<String> nextCachesSet(String cachesArgName)
nextCachesSet0(String, boolean)@NotNull public @NotNull Set<String> nextCacheGroupsSet(String cachesGroupsArgName)
nextCachesSet0(String, boolean)public UUID nextUuidArg(String argName)
argName - Name of the argument to be parsed.public static boolean isCommandOrOption(String raw)
true If raw arg is command, otherwise false.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 8.9.30 Release Date : February 17 2026