public final class ValidationHelper extends Object
| Constructor and Description |
|---|
ValidationHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
ensure(boolean expr,
String msg) |
static void |
ensureExists(String name,
Object value)
Ensure that the specified value exists, conditionally throwing an IllegalArgumentException if it does not.
|
static void |
ensureExists(String name,
String operation,
Object value)
Ensure that the specified value exists, conditionally throwing an IllegalArgumentException if it does not.
|
public static void ensureExists(String name, Object value) throws IllegalArgumentException
Ensure that the specified value exists, conditionally throwing an IllegalArgumentException if it does not.
The exception thrown will contain the name of the parameter that must exist.
name - The name of the object that must exist.value - The object that must exist.IllegalArgumentException - If the specified value does not exist.public static void ensureExists(String name, String operation, Object value) throws IllegalArgumentException
Ensure that the specified value exists, conditionally throwing an IllegalArgumentException if it does not.
The exception thrown will contain the name of the parameter that must exist as well as the operation being attempted.
name - The name of the object that must exist.operation - The operation being attempted.value - The object that must exist.IllegalArgumentException - If the specified value does not exist.public static void ensure(boolean expr,
String msg)
Copyright © 2010–2020 meanbean. All rights reserved.