Class Contract.ConditionalPostcondition
- java.lang.Object
-
- org.checkerframework.framework.util.Contract
-
- org.checkerframework.framework.util.Contract.ConditionalPostcondition
-
- Enclosing class:
- Contract
public static class Contract.ConditionalPostcondition extends Contract
Represents a conditional postcondition that must be verified byBaseTypeVisitor
or one of its subclasses. Automatically extracted from annotations with meta-annotation@ConditionalPostconditionAnnotation
, such asEnsuresNonNullIf
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.checkerframework.framework.util.Contract
Contract.ConditionalPostcondition, Contract.Kind, Contract.Postcondition, Contract.Precondition
-
-
Field Summary
Fields Modifier and Type Field Description boolean
resultValue
The return value for the annotated method that ensures that the conditional postcondition holds.-
Fields inherited from class org.checkerframework.framework.util.Contract
annotation, contractAnnotation, expressionString, kind
-
-
Constructor Summary
Constructors Constructor Description ConditionalPostcondition(java.lang.String expressionString, javax.lang.model.element.AnnotationMirror annotation, javax.lang.model.element.AnnotationMirror contractAnnotation, boolean resultValue)
Create a new conditional postcondition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(@Nullable java.lang.Object o)
int
hashCode()
java.lang.String
toString()
-
Methods inherited from class org.checkerframework.framework.util.Contract
create, viewpointAdaptDependentTypeAnnotation
-
-
-
-
Field Detail
-
resultValue
public final boolean resultValue
The return value for the annotated method that ensures that the conditional postcondition holds. For example, given@EnsuresNonNullIf(expression="foo", result=false) boolean method()
foo
is guaranteed to be@NonNull
after a call tomethod()
that returnsfalse
.
-
-
Constructor Detail
-
ConditionalPostcondition
public ConditionalPostcondition(java.lang.String expressionString, javax.lang.model.element.AnnotationMirror annotation, javax.lang.model.element.AnnotationMirror contractAnnotation, boolean resultValue)
Create a new conditional postcondition.- Parameters:
expressionString
- the Java expression that should have a type qualifierannotation
- the type qualifier thatexpressionString
should havecontractAnnotation
- the postcondition annotation that the programmer wrote; used for diagnostic messagesresultValue
- whether the condition is the method returning true or false
-
-