Class Validation


  • public abstract class Validation
    extends Object
    Author:
    Philipp Meinen
    • Constructor Detail

      • Validation

        protected Validation()
    • Method Detail

      • notNegative

        public static int notNegative​(int value)
      • notNegative

        public static int notNegative​(int value,
                                      String message)
      • notNegative

        public static long notNegative​(long value)
      • notNegative

        public static long notNegative​(long value,
                                       String message)
      • notNull

        public static <T> T notNull​(T obj)
      • notNull

        public static <T> T notNull​(T obj,
                                    String message)
      • isTrue

        public static boolean isTrue​(boolean value)
      • isTrue

        public static boolean isTrue​(boolean value,
                                     String message)
      • isFalse

        public static boolean isFalse​(boolean value)
      • isFalse

        public static boolean isFalse​(boolean value,
                                      String message)
      • notNullOrEmpty

        public static <T extends CharSequence> T notNullOrEmpty​(T value)
      • notNullOrEmpty

        public static <T extends CharSequence> T notNullOrEmpty​(T value,
                                                                String message)
      • notNullOrEmpty

        public static <T extends Collection<?>> T notNullOrEmpty​(T value)
      • notNullOrEmpty

        public static <T extends Collection<?>> T notNullOrEmpty​(T value,
                                                                 String message)
      • notNullOrEmpty

        public static <T extends Map<?,​?>> T notNullOrEmpty​(T value)
      • notNullOrEmpty

        public static <T extends Map<?,​?>> T notNullOrEmpty​(T value,
                                                                  String message)
      • notNullOrEmpty

        public static <T> T[] notNullOrEmpty​(T[] values)
      • notNullOrEmpty

        public static <T> T[] notNullOrEmpty​(T[] values,
                                             String message)
      • noNullValues

        public static <T> T[] noNullValues​(T[] values)
      • noNullValues

        public static <T> T[] noNullValues​(T[] values,
                                           String message)
      • equalLengths

        public static void equalLengths​(Object[][] matrix)
        Verifies that all arrays of a two-dimensional array are of equal length.
        Parameters:
        matrix - the two dimensional array to be verified.
      • equalLengths

        public static void equalLengths​(Object[][] matrix,
                                        String message)
        Verifies that all arrays of a two-dimensional array are of equal length.
        Parameters:
        matrix - the two dimensional array to be verified.
        message - the error to throw upon encountering a validation mismatch.