public class Postcondition extends SpecificationClause
Postcondition is a specification clause of a contract on the outcome of the invocation
of an operation. The specification consists of a Guard and a Property. For an
invocation of the operation, if the Guard evaluates to true, then the Property
must also be true.
The JSON serialization of this class is used to read the specifications for an operation given
using the --specifications command-line option. The JSON should include a JSON object
labeled by the name of each field of this class, as in
{
"property": {
"conditionText": "result >= 0",
"description": "received value is non-negative"
},
"description": "returns non-negative received value",
"guard": {
"conditionText": "true",
"description": ""
}
}
See the classes Guard and Property for details on specifying those objects.| Modifier and Type | Field and Description |
|---|---|
private Property |
property
The post-condition.
|
| Modifier | Constructor and Description |
|---|---|
private |
Postcondition()
Gson serialization requires a default constructor.
|
|
Postcondition(java.lang.String description,
Guard guard,
Property property)
Creates a
Postcondition with the given guard and property. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(@Nullable java.lang.Object object) |
Property |
getProperty()
Gets the
Property (post-condition) for this specification. |
int |
hashCode() |
java.lang.String |
toString() |
getDescription, getGuardprivate final Property property
private Postcondition()
public Postcondition(java.lang.String description,
Guard guard,
Property property)
Postcondition with the given guard and property.public Property getProperty()
Property (post-condition) for this specification.public boolean equals(@Nullable java.lang.Object object)
equals in class SpecificationClausepublic int hashCode()
hashCode in class SpecificationClausepublic java.lang.String toString()
toString in class java.lang.Object