Package: org.apache.groovy.contracts.domain

## [Java] Class Assertion<T extends Assertion>

- org.apache.groovy.contracts.domain.Assertion

-     public abstract class Assertion<T extends Assertion>
      extends Object

  Base class for all assertion types.

  Type Parameters:
    `T` - the concrete assertion subtype used for logical composition

- - ### Constructor Summary

    Constructors
    Constructor and description
    `Assertion()` Creates an assertion that defaults to `true`.
    `Assertion(BlockStatement blockStatement, BooleanExpression booleanExpression)` Creates an assertion backed by the original block and normalized boolean expression.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `and(T other)` Conjoins this assertion with another assertion of the same kind.
    `` | `public BooleanExpression` | `booleanExpression()` Returns the boolean expression used when generating the runtime assertion.
    `` | `public void` | `or(T other)` Disjoins this assertion with another assertion of the same kind.
    `` | `public BlockStatement` | `originalBlockStatement()` Returns the original block statement from which this assertion was derived.
    `` | `public void` | `renew(BooleanExpression booleanExpression)` Replaces the current boolean expression while preserving the existing source mapping strategy.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public Assertion()

      Creates an assertion that defaults to `true`.

    - #### public Assertion(BlockStatement blockStatement, BooleanExpression booleanExpression)

      Creates an assertion backed by the original block and normalized boolean expression.

      Parameters:
        `blockStatement` - the original contract block, or `null` if unavailable
        `booleanExpression` - the normalized expression to evaluate

  - ### Method Detail

    - #### public void and(T other)

      Conjoins this assertion with another assertion of the same kind.

      Parameters:
        `other` - the assertion to combine with a logical AND

    - #### public BooleanExpression booleanExpression()

      Returns the boolean expression used when generating the runtime assertion.

      Returns:
        the current boolean expression

    - #### public void or(T other)

      Disjoins this assertion with another assertion of the same kind.

      Parameters:
        `other` - the assertion to combine with a logical OR

    - #### public BlockStatement originalBlockStatement()

      Returns the original block statement from which this assertion was derived.

      Returns:
        the original contract block, or `null` if it is unavailable

    - #### public void renew(BooleanExpression booleanExpression)

      Replaces the current boolean expression while preserving the existing source mapping strategy.

      Parameters:
        `booleanExpression` - the new boolean expression