S - the type of the non-SPI interface extending this interfaceT - the type of the parameterpublic interface ObjectRequirementsSpi<S extends ObjectRequirementsSpi<S,T>,T>
Object parameter.
| Modifier and Type | Method and Description |
|---|---|
S |
isEqualTo(T value)
Ensures that the parameter is equal to a value.
|
S |
isEqualTo(T value,
String name)
Ensures that the parameter is equal to a variable.
|
S |
isInstanceOf(Class<?> type)
Ensures that the parameter is an instance of a class.
|
S |
isNotEqualTo(T value)
Ensures that the parameter is not equal to a value.
|
S |
isNotEqualTo(T value,
String name)
Ensures that the parameter is not equal to a variable.
|
S |
isNotNull()
Ensures that the parameter is not null.
|
S |
isNull()
Ensures that the parameter is null.
|
S |
withContext(Map<String,Object> context)
Supplies additional key-value pairs to output if a requirement is not met.
|
S |
withException(Class<? extends RuntimeException> exception)
Overrides the type of exception that will get thrown if a requirement fails.
|
S withException(Class<? extends RuntimeException> exception)
exception - the type of exception to throw, null to disable the override@Beta S withContext(Map<String,Object> context) throws NullPointerException
context - a map of key-value pairsNullPointerException - if context is nullS isEqualTo(T value) throws IllegalArgumentException
value - the value to compare toIllegalArgumentException - if parameter is not equal to valueS isEqualTo(T value, String name) throws NullPointerException, IllegalArgumentException
value - the value to compare toname - the name of the variableNullPointerException - if name is nullIllegalArgumentException - if parameter is not equal to the variable; if
name is emptyS isNotEqualTo(T value) throws IllegalArgumentException
value - the value to compare toIllegalArgumentException - if parameter is equal to valueS isNotEqualTo(T value, String name) throws NullPointerException, IllegalArgumentException
value - the value to compare toname - the name of the variableNullPointerException - if name is nullIllegalArgumentException - if parameter is equal to the variable; if name
is emptyS isInstanceOf(Class<?> type) throws NullPointerException, IllegalArgumentException
type - the class to compare toNullPointerException - if type are nullIllegalArgumentException - if parameter is not an instance of typeS isNull() throws IllegalArgumentException
IllegalArgumentException - if parameter is not nullS isNotNull() throws NullPointerException
NullPointerException - if parameter is nullCopyright © 2016. All rights reserved.