Package org.rspeer.commons
Class Mapping
- java.lang.Object
- 
- org.rspeer.commons.Mapping
 
- 
 public class Mapping extends Object Mapping utilities
- 
- 
Constructor SummaryConstructors Constructor Description Mapping()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> voidifPresent(Supplier<T> supplier, Consumer<T> consumer)static <T,R>
 RorDefault(Supplier<T> supplier, Function<T,R> function, R fallback)static <T> intorDefault(Supplier<T> supplier, ToIntFunction<T> function, int fallback)static <T> booleanorElse(Supplier<T> supplier, Predicate<T> function)static <T> booleanorElse(Supplier<T> supplier, Predicate<T> function, boolean fallback)static <T> intorM1(Supplier<T> supplier, ToIntFunction<T> function)static <T,R>
 RorNull(Supplier<T> supplier, Function<T,R> function)
 
- 
- 
- 
Method Detail- 
orDefaultpublic static <T,R> R orDefault(Supplier<T> supplier, Function<T,R> function, R fallback) - Type Parameters:
- T- argument type
- R- return type
- Parameters:
- supplier- The supplier
- function- The function to apply
- fallback- The value to return if the supplied arg is null
- Returns:
- Applies a single argument function to the supplied argument and returns the result if the arg is not null, else returns the fallback value
 
 - 
orElsepublic static <T> boolean orElse(Supplier<T> supplier, Predicate<T> function, boolean fallback) 
 - 
orDefaultpublic static <T> int orDefault(Supplier<T> supplier, ToIntFunction<T> function, int fallback) 
 - 
orM1public static <T> int orM1(Supplier<T> supplier, ToIntFunction<T> function) 
 
- 
 
-