public class Args extends Object
| Constructor and Description |
|---|
Args() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isFalse(boolean argument,
String msg,
Object... params)
Check if argument is false
|
static boolean |
isTrue(boolean argument,
String msg,
Object... params)
Check if argument is true
|
static <T extends CharSequence> |
notEmpty(T argument,
String name)
Checks argument is not empty (not null and has a non-whitespace character)
|
static <T extends Collection<?>> |
notEmpty(T collection,
String name)
Checks argument is not null or empty
|
static <T extends Collection<?>> |
notEmpty(T collection,
String message,
Object... params)
Checks argument is not null or empty
|
static <T> T |
notNull(T argument,
String name)
Checks argument is not null
|
static <T extends Comparable<? super T>> |
withinRange(T min,
T max,
T value,
String name)
Checks if argument is within a range
|
public static <T> T notNull(T argument,
String name)
T - argument - name - IllegalArgumentExceptionpublic static <T extends CharSequence> T notEmpty(T argument, String name)
T - the type of the argument to check for emptinessargument - the argument to check for emptinessname - the name to use in the error messageargument parameter if not emptyIllegalArgumentException - when the passed argument is emptypublic static <T extends Collection<?>> T notEmpty(T collection, String message, Object... params)
collection - message - params - IllegalArgumentException - if the passed collection is either null or emptypublic static <T extends Collection<?>> T notEmpty(T collection, String name)
collection - name - IllegalArgumentException - if the passed collection is either null or emptypublic static <T extends Comparable<? super T>> T withinRange(T min, T max, T value, String name)
T - min - max - value - name - IllegalArgumentExceptionpublic static boolean isTrue(boolean argument,
String msg,
Object... params)
argument - msg - params - Copyright © 2006–2021 Apache Software Foundation. All rights reserved.