Class IterableUtils

java.lang.Object
org.craftercms.commons.collections.IterableUtils

public class IterableUtils extends Object
Utility methods for Iterable.
Author:
avasquez
  • Method Details

    • toList

      public static <T> List<T> toList(Iterable<T> iterable)
      Creates a new list from the iterable elements.
      Parameters:
      iterable - the iterable
      Returns:
      a list with the iterable elements
    • count

      public static <T> int count(Iterable<T> iterable)
      Returns the number of elements the iterable contains.
      Parameters:
      iterable - the iterable
      Returns:
      the element count of the iterable