Class CIterableUtil


  • public class CIterableUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      CIterableUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <E> boolean contains​(java.lang.Iterable<E> iterable, E e)
      Check if iterable contain the element.
      static <E> boolean containsAll​(java.lang.Iterable<E> iterable1, java.lang.Iterable<E> iterable2)
      Check if actual iterable contains all elements from the expected iterable.
      static <E> java.lang.Boolean has​(java.lang.Iterable<E> iterable, java.util.function.Predicate<E> expected)
      Check if iterable has any method which its result of predicate call is true.
      static boolean isEmpty​(java.lang.Iterable iterable)
      Check if iterable is empty.
      static boolean isNotEmpty​(java.lang.Iterable iterable)
      Check if iterable contains any value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CIterableUtil

        public CIterableUtil()
    • Method Detail

      • containsAll

        public static <E> boolean containsAll​(java.lang.Iterable<E> iterable1,
                                              java.lang.Iterable<E> iterable2)
        Check if actual iterable contains all elements from the expected iterable. Please note that actual iterable might have more elements.
        Parameters:
        iterable1 - value to compare
        iterable2 - value to compare
        Returns:
        execution boolean result
      • contains

        public static <E> boolean contains​(java.lang.Iterable<E> iterable,
                                           E e)
        Check if iterable contain the element.
        Parameters:
        iterable - to check
        e - value to search for
        Returns:
        execution boolean result
      • isNotEmpty

        public static boolean isNotEmpty​(java.lang.Iterable iterable)
        Check if iterable contains any value.
        Parameters:
        iterable - to check
        Returns:
        execution boolean result
      • isEmpty

        public static boolean isEmpty​(java.lang.Iterable iterable)
        Check if iterable is empty.
        Parameters:
        iterable - to check
        Returns:
        execution boolean result
      • has

        public static <E> java.lang.Boolean has​(java.lang.Iterable<E> iterable,
                                                java.util.function.Predicate<E> expected)
        Check if iterable has any method which its result of predicate call is true.
        Parameters:
        iterable - to check
        Returns:
        execution boolean result