public interface Assertable
For example, if a public method does not allow null
arguments
or must return not null values, asserts can be used to protect against
contract violations or class's invariants, ensuring preconditions and postconditions.
Modifier and Type | Method and Description |
---|---|
void |
verify(Object... args)
Verify if a set objects assure the assertion.
|
void |
verify(RuntimeException e,
Object... args) |
void |
verifyArray(Object[] args)
Verify if a the array assure the assertion.
|
void |
verifyArray(RuntimeException e,
Object[] args) |
void verify(Object... args)
args
- set object must assure the assertion.
throws Throw a RuntimeException
exception or subclass when the the assertion fails.void verify(RuntimeException e, Object... args)
e
- The exception must be throw when arguments the assertion fails.args
- Arguments to verify against the assertion
throws Throw a specific RuntimeException
exception when the the assertion fails.void verifyArray(Object[] args)
args
- the array to check the assertion.
throws Throw a RuntimeException
exception or subclass when the the assertion fails.void verifyArray(RuntimeException e, Object[] args)
e
- The exception must be throw when arguments the assertion fails.args
- the array to check the assertion.
throws Throw a specific RuntimeException
exception when the the assertion fails.Copyright © 2012–2020 jkniv, copyleft code. All rights reserved.