Package: org.apache.groovy.contracts.domain

## [Java] Class ClassInvariant

- org.apache.groovy.contracts.domain.ClassInvariant

-     public class ClassInvariant
      extends Assertion

  A class-invariant assertion.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static ClassInvariant` | `DEFAULT` | Shared invariant instance representing an unconstrained class invariant.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `ClassInvariant()` Creates a class invariant that defaults to `true`.
    `ClassInvariant(BlockStatement blockStatement, BooleanExpression booleanExpression)` Creates a class invariant from the supplied source block and boolean expression.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Assertion` | `and, booleanExpression, or, originalBlockStatement, renew`

- - ### Field Detail

    - #### public static final ClassInvariant DEFAULT

      Shared invariant instance representing an unconstrained class invariant.

  - ### Constructor Detail

    - #### public ClassInvariant()

      Creates a class invariant that defaults to `true`.

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

      Creates a class invariant from the supplied source block and boolean expression.

      Parameters:
        `blockStatement` - the original invariant block
        `booleanExpression` - the normalized invariant expression