# Package groovy.contracts

package groovy.contracts
Design-by-contract (DbC) support with compile-time assertion generation.

`@Requires` (precondition), `@Ensures` (postcondition), `@Invariant` (class invariant). Postconditions can access `result` and `old()` values.

- Annotation Interfaces
  Class
  Description
  Contracted
  Package-level and class-level annotation indicating that the package is enabled for class-invariants, pre- and post-conditions.
  Decreases
  Specifies a termination measure for a loop.
  Ensures
  Represents a method postcondition.
  EnsuresConditions
  Represents multiple postconditions.
  Invariant
  Represents a class-invariant or a loop invariant.
  Invariants
  Represents multiple invariants
  Modifies
  Declares the frame condition for a method: the set of fields and parameters that the method is allowed to modify.
  ModifiesConditions
  Container for multiple `Modifies` annotations on the same method.
  Requires
  Represents a method precondition.
  RequiresConditions
  Represents multiple preconditions.