Class Validators


  • public class Validators
    extends Object
    Common validators used throughout the client.
    Since:
    2.0.0
    • Method Detail

      • notNull

        public static <T> T notNull​(T input,
                                    String identifier)
        Check if the given input is not null.

        If it is null, a InvalidArgumentException is raised with a proper message.

        Parameters:
        input - the input to check.
        identifier - the identifier that is part of the exception message.
      • notNullOrEmpty

        public static String notNullOrEmpty​(String input,
                                            String identifier)
        Check if the given string is not null or empty.

        If it is null or empty, a InvalidArgumentException is raised with a proper message.

        Parameters:
        input - the string to check.
        identifier - the identifier that is part of the exception message.
      • notNullOrEmpty

        public static <T> List<T> notNullOrEmpty​(List<T> input,
                                                 String identifier)
      • notNullOrEmpty

        public static <T> Set<T> notNullOrEmpty​(Set<T> input,
                                                String identifier)