Class Predicates2


  • public class Predicates2
    extends Object
    • 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,
                                                                    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.