public abstract class Contract extends Object
| Modifier and Type | Class and Description | 
|---|---|
| static class  | Contract.ConditionalPostconditionRepresents a conditional postcondition that must be verified by  BaseTypeVisitoror
 one of its subclasses. | 
| static class  | Contract.KindEnumerates the kinds of contracts. | 
| static class  | Contract.PostconditionA postcondition contract. | 
| static class  | Contract.PreconditionA precondition contract. | 
| Modifier and Type | Field and Description | 
|---|---|
| AnnotationMirror | annotationThe annotation that must be on the type of expression, according to this contract. | 
| AnnotationMirror | contractAnnotationThe annotation that expressed this contract; used for diagnostic messages. | 
| String | expressionThe expression for which the condition must hold, such as  "foo"in@RequiresNonNull("foo"). | 
| Contract.Kind | kindThe kind of contract: precondition, postcondition, or conditional postcondition. | 
| Constructor and Description | 
|---|
| Contract(Contract.Kind kind,
        String expression,
        AnnotationMirror annotation,
        AnnotationMirror contractAnnotation)Creates a new Contract. | 
| Modifier and Type | Method and Description | 
|---|---|
| static Contract | create(Contract.Kind kind,
      String expression,
      AnnotationMirror annotation,
      AnnotationMirror contractAnnotation,
      Boolean ensuresQualifierIf)Creates a new Contract. | 
| boolean | equals(@Nullable Object o) | 
| int | hashCode() | 
| String | toString() | 
public final String expression
"foo" in
 @RequiresNonNull("foo").
 An annotation like @RequiresNonNull({"a", "b", "c"}) would be represented by
 multiple Contracts.
public final AnnotationMirror annotation
public final AnnotationMirror contractAnnotation
public final Contract.Kind kind
public Contract(Contract.Kind kind, String expression, AnnotationMirror annotation, AnnotationMirror contractAnnotation)
kind - precondition, postcondition, or conditional postconditionexpression - the Java expression that should have a type qualifierannotation - the type qualifier that expression should havecontractAnnotation - the pre- or post-condition annotation that the programmer wrote;
     used for diagnostic messagespublic static Contract create(Contract.Kind kind, String expression, AnnotationMirror annotation, AnnotationMirror contractAnnotation, Boolean ensuresQualifierIf)
expression - the Java expression that should have a type qualifierannotation - the type qualifier that expression should havecontractAnnotation - the pre- or post-condition annotation that the programmer wrote;
     used for diagnostic messageskind - precondition, postcondition, or conditional postconditionensuresQualifierIf - the ensuresQualifierIf field, for a conditional postcondition