Class EnclosedIterable.Functions

java.lang.Object
com.atlassian.jira.util.collect.EnclosedIterable.Functions
Enclosing interface:
EnclosedIterable<T>

public static class EnclosedIterable.Functions extends Object
  • Constructor Details

    • Functions

      public Functions()
  • Method Details

    • apply

      public static <T> void apply(EnclosedIterable<T> iterable, Consumer<T> sink)
      Pass all the elements of the iterable to the supplied Consumer. Guarantees that the iterator used will be closed correctly
      Parameters:
      iterable - containing elements of type T
      sink - that will consume the elements
    • toList

      public static <T> List<T> toList(EnclosedIterable<T> iterable)
      Get an ArrayList of the contents of the supplied EnclosedIterable
      Returns:
      a mutable ArrayList containing all elements of the iterable.
    • toList

      public static <I, O> List<O> toList(EnclosedIterable<I> iterable, Function<I,O> transformer)
      Get an ArrayList of the contents of the supplied EnclosedIterable transformed by the supplied transform function into the new type O.
      Returns:
      a mutable ArrayList containing all elements of the iterable.