Package eu.bandm.tools.util.java
Class Objects
java.lang.Object
eu.bandm.tools.util.java.Objects
Library of constants and operations for working with object references.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <D,
E> E ifNullElse
(D input, Supplier<E> nullCase, Function<D, E> notNull) Computes a value from an argument depending on whether it is null.
-
Method Details
-
ifNullElse
Computes a value from an argument depending on whether it is null.- Type Parameters:
D
- the type of the argumentE
- the type of the result- Parameters:
input
- the argument, maybenull
nullCase
- a function to compute the result if the argument is nullnotNull
- a function to compute the result if the argument is non-null- Returns:
- the result computed either way
-