Package com.io7m.jaffirm.core
Class ContractException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.io7m.jaffirm.core.ContractException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
InvariantViolationException,PostconditionViolationException,PreconditionViolationException
One or more conditions have been violated.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedContractException(String message, int in_violations) Construct an exception.protectedContractException(String message, Throwable cause, int in_violations) Construct an exception. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ContractException
Construct an exception.- Parameters:
cause- The causemessage- The messagein_violations- The number of violated conditions
-
ContractException
Construct an exception.- Parameters:
message- The messagein_violations- The number of violated conditions
-
-
Method Details
-
violations
public final int violations()- Returns:
- The number of violated conditions (must be
> 0).
-