edu.wpi.first.wpilibj.util

## Class BoundaryException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - edu.wpi.first.wpilibj.util.BoundaryException

- All Implemented Interfaces:
    java.io.Serializable

      public class BoundaryException
      extends java.lang.RuntimeException

  This exception represents an error in which a lower limit was set as higher than an upper limit.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BoundaryException(java.lang.String message)` Create a new exception with the given message.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `assertWithinBounds(double value, double lower, double upper)` Make sure that the given value is between the upper and lower bounds, and throw an exception if they are not.
    `static java.lang.String` | `getMessage(double value, double lower, double upper)` Returns the message for a boundary exception.

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

    - #### BoundaryException

          public BoundaryException(java.lang.String message)

      Create a new exception with the given message.
      Parameters:
        `message` - the message to attach to the exception

  - ### Method Detail

    - #### assertWithinBounds

          public static void assertWithinBounds(double value,
                                                double lower,
                                                double upper)

      Make sure that the given value is between the upper and lower bounds, and throw an exception if they are not.
      Parameters:
        `value` - The value to check.
        `lower` - The minimum acceptable value.
        `upper` - The maximum acceptable value.

    - #### getMessage

          public static java.lang.String getMessage(double value,
                                                    double lower,
                                                    double upper)

      Returns the message for a boundary exception. Used to keep the message consistent across all boundary exceptions.
      Parameters:
        `value` - The given value
        `lower` - The lower limit
        `upper` - The upper limit
      Returns:
        the message for a boundary exception