Class Assert

    • Method Detail

      • notNull

        public static boolean notNull​(Object object)
        Parameters:
        object - to assert
        Returns:
        TRUE assertion when given objects is not null, FALSE otherwise
      • isNull

        public static boolean isNull​(Object object)
        Parameters:
        object - to assert
        Returns:
        TRUE assertion when given objects is null, FALSE otherwise
      • not

        public static boolean not​(boolean assertion)
        Parameters:
        assertion - expression to be negated
        Returns:
        just negates the assertion
      • hasText

        public static boolean hasText​(String text)
        Parameters:
        text - to assert
        Returns:
        TRUE when given text has any character, FALSE otherwise
      • contains

        public static boolean contains​(String textToSearch,
                                       String substring)
        Parameters:
        textToSearch - complete text
        substring - text to search in textToSearch param
        Returns:
        TRUE when given text contains the given substring, FALSE otherwise
      • notEmpty

        public static boolean notEmpty​(Object[] array)
        Parameters:
        array - list to check emptiness
        Returns:
        TRUE when given array has elements; that is, it must not be null and must have at least one element. FALSE otherwise
      • notEmpty

        public static boolean notEmpty​(Collection<?> collection)
        Parameters:
        collection - collection to check emptiness
        Returns:
        TRUE when given collection has elements; that is, it must not be null and must have at least one element. @return FALSE otherwise
      • hasElements

        public static boolean hasElements​(Object[] array)
        Parameters:
        array - to check elements
        Returns:
        TRUE when given array has at least one not null element; FALSE otherwise
      • hasElements

        public static boolean hasElements​(Collection array)
        Parameters:
        array - to check elements
        Returns:
        TRUE when given array has at least one not null element; FALSE otherwise
      • notEmpty

        public static boolean notEmpty​(Map<?,​?> map)
        Parameters:
        map - to check emptiness
        Returns:
        TRUE if given Map has entries; that is, it must not be null and must have at least one entry. Queue FALSE otherwise
      • notNull

        public static boolean notNull​(Object[] array)
        Assert that an array has no null elements. Note: Does not complain if the array is empty!
         Assert.noNullElements(array, "The array must have non-null elements");
         
        Parameters:
        array - the array
        Returns:
        TRUE when given array has no null elements; FALSE otherwise