public class PrerequisiteChecker extends Object
PrerequisiteChecker.checkThat().notNull(ob1, ob2).notEmpty(coll).withNames("ob1", "ob2", "coll").execute().
In case that any of the checks fail on execute(), a message will be recorded for each failed check.
Then, an IllegalArgumentException is thrown explaining what went wrong.| Modifier and Type | Field and Description |
|---|---|
static String |
PREREQUISITE_CHECKS_ENABLED |
| Modifier and Type | Method and Description |
|---|---|
static PrerequisiteChecker |
checkThat() |
void |
execute()
Checks for null items and, if found, generates an error message.
|
PrerequisiteChecker |
notEmpty(Collection<?>... collections) |
PrerequisiteChecker |
notNull(Object... objects) |
PrerequisiteChecker |
supplyNotEmpty(java.util.function.Supplier<Collection<?>>... collections) |
PrerequisiteChecker |
supplyNotNull(java.util.function.Supplier<?>... objectSuppliers) |
PrerequisiteChecker |
withNames(String... names)
Sets the names for all items previously added to the checker, possibly in multiple calls.
|
public static final String PREREQUISITE_CHECKS_ENABLED
public static PrerequisiteChecker checkThat()
public PrerequisiteChecker withNames(String... names)
names - The names to give to the last list of items to checkpublic PrerequisiteChecker notNull(Object... objects)
public PrerequisiteChecker notEmpty(Collection<?>... collections)
public PrerequisiteChecker supplyNotEmpty(java.util.function.Supplier<Collection<?>>... collections)
public PrerequisiteChecker supplyNotNull(java.util.function.Supplier<?>... objectSuppliers)
public void execute()
Copyright © 2019 JULIE Lab, Germany. All rights reserved.