Package org.rspeer.commons
Class Mapping
java.lang.Object
org.rspeer.commons.Mapping
Mapping utilities
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> void
static <T,
R> R static <T> int
orDefault
(Supplier<T> supplier, ToIntFunction<T> function, int fallback) static <T> boolean
static <T> boolean
static <T> int
orM1
(Supplier<T> supplier, ToIntFunction<T> function) static <T,
R> R
-
Constructor Details
-
Mapping
public Mapping()
-
-
Method Details
-
orDefault
- Type Parameters:
T
- argument typeR
- return type- Parameters:
supplier
- The supplierfunction
- The function to applyfallback
- 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
-
orNull
-
orElse
-
orElse
-
orDefault
-
orM1
-
ifPresent
-