public class ObjectCheck extends java.lang.Object implements Check
Sequence, for example:
toString() on the objects created during execution of a
sequence does not throw an exception.
An ObjectCheck has two parts:
ObjectContract responsible for performing the actual check on a
set of runtime values. For example. the class EqualsReflexive is a
checker code class that, given an object o, calls o.equals(o) and checks that
it returns true.
Variables, which describe the specific objects in the sequence that the
check is over.
| Modifier and Type | Field and Description |
|---|---|
private ObjectContract |
contract
The contract that is checked.
|
private Variable[] |
vars
The variables for the contract.
|
| Constructor and Description |
|---|
ObjectCheck(ObjectContract contract,
Variable... vars)
Creates an
ObjectCheck for the given contract using the variables as input. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(@Nullable java.lang.Object o) |
int |
hashCode() |
java.lang.String |
toCodeStringPostStatement()
Returns a string of Java source code to be emitted after a statement containing this check.
|
java.lang.String |
toCodeStringPreStatement()
Returns a string of Java source code to be emitted before a statement containing this check.
|
java.lang.String |
toString() |
private final ObjectContract contract
private final Variable[] vars
public ObjectCheck(ObjectContract contract, Variable... vars)
ObjectCheck for the given contract using the variables as input.contract - the contract to checkvars - the input variables for the created checkpublic boolean equals(@Nullable java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toCodeStringPreStatement()
ChecktoCodeStringPreStatement in interface Checkpublic java.lang.String toCodeStringPostStatement()
ChecktoCodeStringPostStatement in interface Check