com.atlassian.gadgets.dashboard.util
Class Iterables

java.lang.Object
  extended by 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 Summary
static
<T> Iterable<T>
checkContentsNotNull(Iterable<T> iterable)
          Checks every element of an Iterable to make sure that none of the elements are null
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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


Copyright © 2013 Atlassian. All Rights Reserved.