org.jclouds.util
Class Predicates2

java.lang.Object
  extended by org.jclouds.util.Predicates2

public class Predicates2
extends Object


Field Summary
static long DEFAULT_MAX_PERIOD
           
static long DEFAULT_PERIOD
           
 
Constructor Summary
Predicates2()
           
 
Method Summary
static
<T> com.google.common.base.Predicate<T>
retry(com.google.common.base.Predicate<T> findOrBreak, long timeout)
          like retry(Predicate, long, long, long, TimeUnit) where unit is in milliseconds, period is 50ms, and maxPeriod 1s.
static
<T> com.google.common.base.Predicate<T>
retry(com.google.common.base.Predicate<T> findOrBreak, long timeout, long period, long maxPeriod)
          like retry(Predicate, long, long, long, TimeUnit) where unit is in milliseconds
static
<T> com.google.common.base.Predicate<T>
retry(com.google.common.base.Predicate<T> findOrBreak, long timeout, long period, long maxPeriod, TimeUnit unit)
          Retries a predicate until it is met, a timeout occurs, or an exception occurs.
static
<T> com.google.common.base.Predicate<T>
retry(com.google.common.base.Predicate<T> findOrBreak, long timeout, long period, TimeUnit unit)
          like retry(Predicate, long, long, long, TimeUnit) where maxPeriod is 10x period
static com.google.common.base.Predicate<String> startsWith(String prefix)
          Returns a predicate that evaluates to true if the String being tested starts with a prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PERIOD

public static final long DEFAULT_PERIOD
See Also:
org.jclouds.compute.config.ComputeServiceProperties#POLL_INITIAL_PERIOD, Constant Field Values

DEFAULT_MAX_PERIOD

public static final long DEFAULT_MAX_PERIOD
See Also:
org.jclouds.compute.config.ComputeServiceProperties#POLL_MAX_PERIOD, Constant Field Values
Constructor Detail

Predicates2

public Predicates2()
Method Detail

startsWith

public static com.google.common.base.Predicate<String> startsWith(String prefix)
Returns a predicate that evaluates to true if the String being tested starts with a prefix.


retry

public static <T> com.google.common.base.Predicate<T> retry(com.google.common.base.Predicate<T> findOrBreak,
                                                            long timeout,
                                                            long period,
                                                            long maxPeriod,
                                                            TimeUnit unit)
Retries a predicate until it is met, a timeout occurs, or an exception occurs.


retry

public static <T> com.google.common.base.Predicate<T> retry(com.google.common.base.Predicate<T> findOrBreak,
                                                            long timeout,
                                                            long period,
                                                            TimeUnit unit)
like retry(Predicate, long, long, long, TimeUnit) where maxPeriod is 10x period


retry

public static <T> com.google.common.base.Predicate<T> retry(com.google.common.base.Predicate<T> findOrBreak,
                                                            long timeout,
                                                            long period,
                                                            long maxPeriod)
like retry(Predicate, long, long, long, TimeUnit) where unit is in milliseconds


retry

public static <T> com.google.common.base.Predicate<T> retry(com.google.common.base.Predicate<T> findOrBreak,
                                                            long timeout)
like retry(Predicate, long, long, long, TimeUnit) where unit is in milliseconds, period is 50ms, and maxPeriod 1s.



Copyright © 2009-2013 jclouds. All Rights Reserved.