Class Assert


  • public class Assert
    extends Object
    Utility class to allow for basic sanity checks.
    • Constructor Detail

      • Assert

        public Assert()
    • Method Detail

      • checkThat

        public static void checkThat​(BooleanSupplier supplier,
                                     String message)
        Throws an exception when the given boolean supplier returns false.
        Parameters:
        supplier - boolean supplier check function
        message - message to be included in the thrown exception
        Throws:
        IllegalArgumentException - when the given boolean supplier returns false
      • checkThat

        public static void checkThat​(BooleanSupplier supplier)
        Throws an exception when the given boolean supplier returns false.
        Parameters:
        supplier - boolean supplier check function
        Throws:
        IllegalArgumentException - when the given boolean supplier returns false
      • checkThat

        public static void checkThat​(boolean value,
                                     String message)
        Throws an exception when the provided boolean is false
        Parameters:
        value - boolean value being checked
        message - message to be included in the thrown exception
        Throws:
        IllegalArgumentException - when the given boolean is false
      • checkThat

        public static void checkThat​(boolean value)
        Throws an exception when the provided boolean is false
        Parameters:
        value - boolean value being checked
        Throws:
        IllegalArgumentException - when the given boolean is false