public abstract class Validate extends Object
| Constructor and Description |
|---|
Validate() |
| Modifier and Type | Method and Description |
|---|---|
static void |
isTrue(boolean expression,
String message)
throws new
IllegalArgumentException if expression is false |
static <T> T[] |
noNullElements(T[] array,
String argument) |
static <T extends Collection> |
noNullElements(T collection,
String argumentName)
Throws IllegalArgumentException if the collection contains null elements (or is null), otherwise returns
the collection.
|
static <T extends CharSequence> |
notEmpty(T value,
String argumentName)
Throws IllegalArgumentException if the char sequence is empty, otherwise returns the char sequence.
|
static <T extends Collection> |
notEmpty(T value,
String argumentName)
Throws IllegalArgumentException if the map is empty, otherwise returns the map.
|
static <T> T |
notNull(T value,
String argumentName)
Throws IllegalArgumentException if the value is null, otherwise returns the value.
|
static <T> T |
notNullState(T value,
String argumentName)
Throws IllegalStateException if the value is null, otherwise returns the value.
|
public static <T> T notNull(T value,
String argumentName)
T - the type of the argumentvalue - input valueargumentName - the name of input argumentpublic static <T extends CharSequence> T notEmpty(T value, String argumentName)
T - the type of char sequencevalue - input char sequenceargumentName - the name of input argumentpublic static <T extends Collection> T notEmpty(T value, String argumentName)
T - the type of mapvalue - input collectionargumentName - the name of the input argumentpublic static <T extends Collection> T noNullElements(T collection, String argumentName)
T - the type of the collectioncollection - input collectionargumentName - the name of input argumentpublic static <T> T[] noNullElements(T[] array,
String argument)
public static <T> T notNullState(T value,
String argumentName)
T - the type of the argumentvalue - input valueargumentName - the name of input argumentpublic static void isTrue(boolean expression,
String message)
IllegalArgumentException if expression is falseexpression - boolean expressionmessage - of exceptionCopyright © 2017. All Rights Reserved.