public class Predicates2 extends Object
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_MAX_PERIOD |
static long |
DEFAULT_PERIOD |
Constructor and Description |
---|
Predicates2() |
Modifier and Type | Method and Description |
---|---|
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)
|
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.
|
public static final long DEFAULT_PERIOD
public static final long DEFAULT_MAX_PERIOD
public static com.google.common.base.Predicate<String> startsWith(String prefix)
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)
public static <T> com.google.common.base.Predicate<T> retry(com.google.common.base.Predicate<T> findOrBreak, long timeout, long period, TimeUnit unit)
public static <T> com.google.common.base.Predicate<T> retry(com.google.common.base.Predicate<T> findOrBreak, long timeout, long period, long maxPeriod)
retry(Predicate, long, long, long, TimeUnit)
where unit
is in millisecondspublic static <T> com.google.common.base.Predicate<T> retry(com.google.common.base.Predicate<T> findOrBreak, long timeout)
retry(Predicate, long, long, long, TimeUnit)
where unit
is in milliseconds, period
is 50ms, and maxPeriod
1s.Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.