Class Postcondition

java.lang.Object
org.apache.groovy.contracts.domain.Assertion<Postcondition>
org.apache.groovy.contracts.domain.Postcondition

public class Postcondition extends Assertion<Postcondition>

A post-condition assertion.

  • Constructor Details

    • Postcondition

      public Postcondition()
      Creates a postcondition that defaults to true.
    • Postcondition

      public Postcondition(BlockStatement blockStatement, BooleanExpression booleanExpression, boolean isPartOfConstructor)
      Creates a postcondition from the supplied source block and boolean expression.
      Parameters:
      blockStatement - the original postcondition block
      booleanExpression - the normalized postcondition expression
      isPartOfConstructor - whether the postcondition belongs to a constructor
  • Method Details

    • isPartOfConstructor

      public boolean isPartOfConstructor()
      Indicates whether this postcondition was declared for a constructor.
      Returns:
      true if the postcondition belongs to a constructor