public class ClassInvariantViolation extends RuntimeException
assert
keyword if you don't want to conditionally check invariants (ie, you wont
need to -enableassertions flag on the VM).
From Wikipedia "Methods of a class should preserve any class invariants. The class invariant constrains the state stored in the
object and should be constantly maintained between calls to public methods. An object invariant, or representation
invariant, is a programming construct consisting of a set of invariant properties that remain uncompromised
regardless of the state of the object. This ensures that the object will always meet predefined conditions,
and that methods may, therefore, always reference the object without the risk of making inaccurate presumptions."http://en.wikipedia.org/wiki/Class_invariant
,
Serialized FormConstructor and Description |
---|
ClassInvariantViolation() |
ClassInvariantViolation(String message) |
ClassInvariantViolation(String message,
Throwable cause) |
ClassInvariantViolation(Throwable cause) |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Copyright © 2009–2019 tempus-fugit committers. All rights reserved.