Class Iterables

java.lang.Object
com.atlassian.gadgets.dashboard.util.Iterables

public class Iterables extends Object
Convenience methods for dealing with Iterables, since we want to avoid introducing a dependency on Google Collections in our public API
  • Method Details

    • elementsEqual

      public static boolean elementsEqual(Iterable<?> i1, Iterable<?> i2)
      Compares two Iterables to determine if they are of equal lengths and contain equal elements in the same order.
      Parameters:
      i1 - the first Iterable to compare
      i2 - the second Iterable to compare
      Returns:
      true if the two Iterables contain equal elements in the same order, false otherwise
    • checkContentsNotNull

      public static <T> Iterable<T> checkContentsNotNull(Iterable<T> iterable)
      Checks every element of an Iterable to make sure that none of the elements are null
      Type Parameters:
      T - the type contained in the Iterable
      Parameters:
      iterable - the Iterable to check
      Returns:
      the Iterable that was passed in