public class PortablePreconditions extends Object
Modifier | Constructor and Description |
---|---|
protected |
PortablePreconditions()
Should not be instantiated
|
Modifier and Type | Method and Description |
---|---|
static void |
checkCondition(String name,
boolean condition)
Assert that this parameter is marked as valid by the condition passed as parameter.
|
static <T> void |
checkEachParameterNotNull(String name,
T... parameters)
Assert that this parameter is not null, as also each item of the array is not null.
|
static void |
checkNotEmpty(String name,
Map<?,?> parameter)
Assert that this parameter is not empty.
|
static String |
checkNotEmpty(String name,
String parameter)
Assert that this parameter is not empty.
|
static <T extends Collection<?>> |
checkNotEmpty(String name,
T parameter)
Assert that this parameter is not empty.
|
static <T> T[] |
checkNotEmpty(String name,
T[] parameter)
Assert that this parameter is not empty.
|
static <T> T |
checkNotNull(String name,
T parameter)
Assert that this parameter is not null.
|
static void |
checkNullMandatory(String name,
Object parameter)
Assert that this parameter is null.
|
protected PortablePreconditions()
public static void checkCondition(String name, boolean condition)
name
- of parametercondition
- itselfpublic static <T> void checkEachParameterNotNull(String name, T... parameters)
T
- parameter typename
- of parameterparameters
- itselfpublic static <T extends Collection<?>> T checkNotEmpty(String name, T parameter)
name
- of parameterparameter
- itselfpublic static void checkNotEmpty(String name, Map<?,?> parameter)
name
- of parameterparameter
- itselfpublic static String checkNotEmpty(String name, String parameter)
name
- of parameterparameter
- itselfpublic static <T> T[] checkNotEmpty(String name, T[] parameter)
T
- type of the arrayname
- of parameterparameter
- itselfpublic static <T> T checkNotNull(String name, T parameter)
name
- of parameterparameter
- itselfCopyright © 2001–2018 JBoss by Red Hat. All rights reserved.