Package org.n52.janmayen.function
Class Suppliers
- java.lang.Object
-
- org.n52.janmayen.function.Suppliers
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <U,V>
Function<U,V>asFunction(Supplier<V> supplier)Creates a function ignoring it's parameter and just returning the supplier's value.static <T> Supplier<T>constant(T t)Returns a constant supplier.static <U,V>
Supplier<V>mapping(Function<? super U,? extends V> mapper, Supplier<U> supplier)Maps the output of an supplier using a function.
-
-
-
Method Detail
-
constant
public static <T> Supplier<T> constant(T t)
Returns a constant supplier.- Type Parameters:
T- the type of the supplied value- Parameters:
t- the constant- Returns:
- the constant supplier
-
mapping
public static <U,V> Supplier<V> mapping(Function<? super U,? extends V> mapper, Supplier<U> supplier)
Maps the output of an supplier using a function.- Type Parameters:
U- The original suppliers return typeV- The new suppliers return type- Parameters:
supplier- the original suppliermapper- the mapper- Returns:
- the new supplier
-
-