public interface Verifier
All implementations must be immutable and final.
| Modifier and Type | Method and Description |
|---|---|
Verifier |
addContext(String key,
Object value)
Appends contextual information to the exception message.
|
Verifier |
withContext(List<Map.Entry<String,Object>> context)
Sets the contextual information to append to the exception message.
|
Verifier |
withException(Class<? extends RuntimeException> exception)
Overrides the type of exception that will get thrown if a requirement fails.
|
Verifier withException(Class<? extends RuntimeException> exception)
The exception class must define the following constructors:
<init>(String message)
<init>(String message, Throwable cause)
exception - the type of exception to throw, null to throw the default exception
type@Beta Verifier addContext(String key, Object value) throws NullPointerException
key - a keyvalue - a valueNullPointerException - if key is null@Beta Verifier withContext(List<Map.Entry<String,Object>> context) throws NullPointerException
context - the contextual informationNullPointerException - if context is nullCopyright © 2016. All rights reserved.