public class CommandArgUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
failIfNull(T val,
String errorMsg)
Returns provided value if it's not
null otherwise
throws IllegalArgumentException with specified message |
static <E extends Enum<E> & CommandArg> |
of(String text,
Class<E> enumClass)
Deprecated.
name
of() is too abstract, consider using ofArg(Class, String) |
static <E extends Enum<E> & CommandArg> |
ofArg(Class<E> enumClass,
@NotNull String text)
Same as
of(String, Class) but name that more clearly reflects its purpose |
static <E extends Enum<E>> |
ofEnum(Class<E> enumClass,
@NotNull String text)
Tries convert
text to one of values enumClass. |
static <C extends Collection<String>> |
validateCachesArgument(C caches,
String operation)
Checks that provided cache list doesn't include illegal values (like internal
utility cache) |
@Deprecated @Nullable public static <E extends Enum<E> & CommandArg> E of(String text, Class<E> enumClass)
of() is too abstract, consider using ofArg(Class, String)text to one of values enumClass.E - command argument type, must extend CommandArgtext - Input text.enumClass - CommandArg enum class, which values will be used for lookupnull if convert failed.@Nullable public static <E extends Enum<E> & CommandArg> E ofArg(Class<E> enumClass, @NotNull @NotNull String text)
of(String, Class) but name that more clearly reflects its purpose@Nullable public static <E extends Enum<E>> E ofEnum(Class<E> enumClass, @NotNull @NotNull String text)
text to one of values enumClass.E - command argument type, must extend CommandArgtext - Input text.enumClass - CommandArg enum class, which values will be used for lookupnull if convert failed.@NotNull
public static <T> T failIfNull(@Nullable
T val,
String errorMsg)
throws IllegalArgumentException
null otherwise
throws IllegalArgumentException with specified messageIllegalArgumentExceptionpublic static <C extends Collection<String>> C validateCachesArgument(C caches, String operation)
utility cache)
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 8.9.30 Release Date : February 17 2026