public static class Contract.ConditionalPostcondition extends Contract
BaseTypeVisitor
or
one of its subclasses. Automatically extracted from annotations with meta-annotation
@ConditionalPostconditionAnnotation
, such as EnsuresNonNullIf
.Contract.ConditionalPostcondition, Contract.Kind, Contract.Postcondition, Contract.Precondition
Modifier and Type | Field and Description |
---|---|
boolean |
resultValue
The return value for the annotated method that ensures that the conditional postcondition
holds.
|
annotation, contractAnnotation, expression, kind
Constructor and Description |
---|
ConditionalPostcondition(String expression,
AnnotationMirror annotation,
AnnotationMirror contractAnnotation,
boolean resultValue)
Create a new conditional postcondition.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(@Nullable Object o) |
int |
hashCode() |
String |
toString() |
public final boolean resultValue
@EnsuresNonNullIf(expression="foo", result=false) boolean method()
foo
is guaranteed to be @NonNull
after a call to method()
if that
call returns false
.public ConditionalPostcondition(String expression, AnnotationMirror annotation, AnnotationMirror contractAnnotation, boolean resultValue)
expression
- the Java expression that should have a type qualifierannotation
- the type qualifier that expression
should havecontractAnnotation
- the postcondition annotation that the programmer wrote; used
for diagnostic messagesresultValue
- whether the condition is the method returning true or false