Package org.apache.groovy.contracts.domain

# Class Precondition

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

public class Precondition extends Assertion<Precondition>

A pre-condition assertion.

- ## Constructor Summary

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

- ## Method Summary

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

  - ### Precondition

    public Precondition()
    Creates a precondition that defaults to `true`.

  - ### Precondition

    public Precondition(BlockStatement blockStatement, BooleanExpression booleanExpression)
    Creates a precondition from the supplied source block and boolean expression.
    Parameters:
      `blockStatement` - the original precondition block
      `booleanExpression` - the normalized precondition expression