Package org.apache.groovy.contracts

# Class PreconditionViolation

java.lang.Object
java.lang.Throwable
java.lang.Error
java.lang.AssertionError
org.apache.groovy.contracts.AssertionViolation
org.apache.groovy.contracts.PreconditionViolation

All Implemented Interfaces:
  `Serializable`

public class PreconditionViolation extends AssertionViolation

Thrown whenever a precondition violation occurs.

See Also:
  - `AssertionViolation`
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PreconditionViolation()`
  Creates a precondition violation without an explicit detail message.
  `PreconditionViolation(boolean b)`
  Creates a precondition violation with a boolean detail.
  `PreconditionViolation(char c)`
  Creates a precondition violation with a character detail.
  `PreconditionViolation(double v)`
  Creates a precondition violation with a double-precision detail.
  `PreconditionViolation(float v)`
  Creates a precondition violation with a floating-point detail.
  `PreconditionViolation(int i)`
  Creates a precondition violation with an integer detail.
  `PreconditionViolation(long l)`
  Creates a precondition violation with a long detail.
  `PreconditionViolation(Object o)`
  Creates a precondition violation with an object-valued detail.

- ## Method Summary

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

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

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

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

- ## Constructor Details

  - ### PreconditionViolation

    public PreconditionViolation()
    Creates a precondition violation without an explicit detail message.

  - ### PreconditionViolation

    public PreconditionViolation(Object o)
    Creates a precondition violation with an object-valued detail.
    Parameters:
      `o` - the detail object

  - ### PreconditionViolation

    public PreconditionViolation(boolean b)
    Creates a precondition violation with a boolean detail.
    Parameters:
      `b` - the detail value

  - ### PreconditionViolation

    public PreconditionViolation(char c)
    Creates a precondition violation with a character detail.
    Parameters:
      `c` - the detail value

  - ### PreconditionViolation

    public PreconditionViolation(int i)
    Creates a precondition violation with an integer detail.
    Parameters:
      `i` - the detail value

  - ### PreconditionViolation

    public PreconditionViolation(long l)
    Creates a precondition violation with a long detail.
    Parameters:
      `l` - the detail value

  - ### PreconditionViolation

    public PreconditionViolation(float v)
    Creates a precondition violation with a floating-point detail.
    Parameters:
      `v` - the detail value

  - ### PreconditionViolation

    public PreconditionViolation(double v)
    Creates a precondition violation with a double-precision detail.
    Parameters:
      `v` - the detail value