Help improvements.
This commit is contained in:
@@ -19,6 +19,14 @@ public final class Utilities {
|
||||
return consumer.apply( value );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public static <T> T ifNotNullElse(@Nullable final T value, @Nonnull final T nullValue) {
|
||||
if (value == null)
|
||||
return nullValue;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public static <T, R> R ifNotNullElse(@Nullable final T value, final Function<T, R> consumer, @Nonnull final R nullValue) {
|
||||
if (value == null)
|
||||
|
Reference in New Issue
Block a user