Class Checks


  • public class Checks
    extends Object
    • Constructor Detail

      • Checks

        public Checks()
    • Method Detail

      • notEmpty

        public static void notEmpty​(String argument,
                                    String message,
                                    Object... params)
        Checks argument is not empty (not null and has a non-whitespace character)
        Parameters:
        argument -
        message -
        params -
        Throws:
        IllegalStateException
      • withinRange

        public static <T extends Comparable<? super T>> void withinRange​(T min,
                                                                         T max,
                                                                         T value,
                                                                         String message)
        Checks if argument is within a range
        Type Parameters:
        T -
        Parameters:
        min -
        max -
        value -
        message -
        Throws:
        IllegalStateException
      • notNullShort

        public static void notNullShort​(Object argument,
                                        String name)
        Checks value is not null
        Parameters:
        argument -
        name -
        Throws:
        IllegalStateException
      • notEmptyShort

        public static void notEmptyShort​(String argument,
                                         String name)
        Checks argument is not empty (not null and has a non-whitespace character)
        Parameters:
        argument -
        name -
        Throws:
        IllegalStateException
      • withinRangeShort

        public static <T extends Comparable<? super T>> void withinRangeShort​(T min,
                                                                              T max,
                                                                              T value,
                                                                              String name)
        Checks if argument is within a range
        Type Parameters:
        T -
        Parameters:
        min -
        max -
        value -
        name -
        Throws:
        IllegalStateException