Class Suppliers2


  • public class Suppliers2
    extends Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Suppliers2()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <K,​V>
      com.google.common.base.Supplier<V>
      getLastValueInMap​(com.google.common.base.Supplier<Map<K,​com.google.common.base.Supplier<V>>> input)  
      static <K,​V>
      com.google.common.base.Supplier<V>
      getValueInMapOrNull​(com.google.common.base.Supplier<Map<K,​com.google.common.base.Supplier<V>>> input, K keyValue)  
      static <X> com.google.common.base.Function<X,​com.google.common.base.Supplier<X>> ofInstanceFunction()  
      static <T,​X extends Throwable>
      com.google.common.base.Supplier<T>
      onThrowable​(com.google.common.base.Supplier<T> unlessThrowable, Class<X> throwable, com.google.common.base.Supplier<T> fallback)
      if a throwable of certain type is encountered on getting the first value, use the fallback.
      static <T> com.google.common.base.Supplier<T> or​(com.google.common.base.Supplier<T> unlessNull, com.google.common.base.Supplier<T> fallback)
      returns the value of the first supplier, or the value of the fallback, if the unlessNull is null.
    • Constructor Detail

      • Suppliers2

        public Suppliers2()
    • Method Detail

      • getLastValueInMap

        public static <K,​V> com.google.common.base.Supplier<V> getLastValueInMap​(com.google.common.base.Supplier<Map<K,​com.google.common.base.Supplier<V>>> input)
      • getValueInMapOrNull

        public static <K,​V> com.google.common.base.Supplier<V> getValueInMapOrNull​(com.google.common.base.Supplier<Map<K,​com.google.common.base.Supplier<V>>> input,
                                                                                         K keyValue)
      • ofInstanceFunction

        public static <X> com.google.common.base.Function<X,​com.google.common.base.Supplier<X>> ofInstanceFunction()
      • or

        @Beta
        public static <T> com.google.common.base.Supplier<T> or​(com.google.common.base.Supplier<T> unlessNull,
                                                                com.google.common.base.Supplier<T> fallback)
        returns the value of the first supplier, or the value of the fallback, if the unlessNull is null.
      • onThrowable

        @Beta
        public static <T,​X extends Throwable> com.google.common.base.Supplier<T> onThrowable​(com.google.common.base.Supplier<T> unlessThrowable,
                                                                                                   Class<X> throwable,
                                                                                                   com.google.common.base.Supplier<T> fallback)
        if a throwable of certain type is encountered on getting the first value, use the fallback.