Class Assert

    • Method Detail

      • state

        public static void state​(boolean expression,
                                 String message)
                          throws IllegalArgumentException
        Asserts if the passed expression is true
        Parameters:
        expression - returns boolean
        message - exception message
        Throws:
        IllegalArgumentException - if the assertion fails
      • notNull

        public static void notNull​(Object object,
                                   String message)
        Asserts if the passed object is not null
        Parameters:
        object - nullable object
        message - exception message
        Throws:
        IllegalArgumentException - if the assertion fails
      • hasText

        public static void hasText​(String object,
                                   String message)
        Asserts if the given String is not empty
        Parameters:
        object - nullable String
        message - exception message
        Throws:
        IllegalArgumentException - if the assertion fails
      • notEmpty

        public static void notEmpty​(Collection<?> collection,
                                    String message)
        Asserts if the given Collection is not empty
        Parameters:
        collection - nullable Collection
        message - exception message
        Throws:
        IllegalArgumentException - if the assertion fails