Package org.apache.groovy.contracts.domain

# 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 Summary

  Constructors
  Constructor
  Description
  `Postcondition()`
  Creates a postcondition that defaults to `true`.
  `Postcondition(BlockStatement blockStatement, BooleanExpression booleanExpression, boolean isPartOfConstructor)`
  Creates a postcondition from the supplied source block and boolean expression.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `isPartOfConstructor()`
  Indicates whether this postcondition was declared for a constructor.

  ### Methods inherited from class org.apache.groovy.contracts.domain.Assertion

  `and, booleanExpression, or, originalBlockStatement, renew`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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