Class AlwaysThrows
java.lang.Object
org.soliscode.test.util.AlwaysThrows
- All Implemented Interfaces:
Comparable<AlwaysThrows>
Class that implements the
Object
and Comparable
interfaces, and that throws an exception when any method is
called.- Author:
- evanbergstrom
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance that always throws anUnsupportedOperationException
for every method call.AlwaysThrows
(Supplier<RuntimeException> exceptionSupplier) Creates an instance that always throws an exception that is provided by the supplier parameter. -
Method Summary
-
Constructor Details
-
AlwaysThrows
public AlwaysThrows()Creates an instance that always throws anUnsupportedOperationException
for every method call. -
AlwaysThrows
Creates an instance that always throws an exception that is provided by the supplier parameter.- Parameters:
exceptionSupplier
- The supplied used to generate exceptions.
-
-
Method Details
-
equals
-
hashCode
-
compareTo
Always throws the supplied exception- Specified by:
compareTo
in interfaceComparable<AlwaysThrows>
- Parameters:
obj
- The object to compare (not used).- Returns:
- Never returns a value
-
toString
-