com.atlassian.bamboo.util
Class BambooIterables

java.lang.Object
  extended by com.atlassian.bamboo.util.BambooIterables

public final class BambooIterables
extends java.lang.Object


Method Summary
static
<T> java.lang.Iterable<T>
concat(java.util.Collection<? extends T> iterable, T object)
          Combines an iterable and an element into a single iterable.
static
<T,E extends java.lang.Throwable,F extends java.lang.Throwable>
T
find(java.lang.Iterable<T> iterable, DoubleThrowingPredicate<? super T,E,F> predicate, T defaultValue)
          Returns the first element in iterable that satisfies the given predicate, or defaultValue if none found.
static
<T> T
find(java.lang.Iterable<T> iterable, com.google.common.base.Predicate<? super T> predicate, java.lang.String exceptionMessage)
          Utility method to customize exception message thrown by Iterables.find(Iterable, com.google.common.base.Predicate).
static
<T,E extends java.lang.Throwable>
T
find(java.lang.Iterable<T> iterable, ThrowingPredicate<? super T,E> predicate, T defaultValue)
          Returns the first element in iterable that satisfies the given predicate, or defaultValue if none found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

find

@Nullable
public static <T,E extends java.lang.Throwable> T find(java.lang.Iterable<T> iterable,
                                                                ThrowingPredicate<? super T,E> predicate,
                                                                @Nullable
                                                                T defaultValue)
              throws E extends java.lang.Throwable
Returns the first element in iterable that satisfies the given predicate, or defaultValue if none found.

Throws:
E extends java.lang.Throwable

find

@Nullable
public static <T,E extends java.lang.Throwable,F extends java.lang.Throwable> T find(java.lang.Iterable<T> iterable,
                                                                                              DoubleThrowingPredicate<? super T,E,F> predicate,
                                                                                              @Nullable
                                                                                              T defaultValue)
              throws E extends java.lang.Throwable,
                     F extends java.lang.Throwable
Returns the first element in iterable that satisfies the given predicate, or defaultValue if none found.

Throws:
E extends java.lang.Throwable

find

public static <T> T find(java.lang.Iterable<T> iterable,
                         com.google.common.base.Predicate<? super T> predicate,
                         @Nullable
                         java.lang.String exceptionMessage)
Utility method to customize exception message thrown by Iterables.find(Iterable, com.google.common.base.Predicate).


concat

public static <T> java.lang.Iterable<T> concat(java.util.Collection<? extends T> iterable,
                                               T object)
Combines an iterable and an element into a single iterable. The returned iterable has an iterator that traverses the elements in a, followed by the elements in b. The source iterator is not polled until necessary. The returned iterable's iterator supports remove() when the corresponding input iterator supports it.



Copyright © 2012 Atlassian. All Rights Reserved.