public final class Objects extends Object
Constructor and Description |
---|
Objects() |
Modifier and Type | Method and Description |
---|---|
static boolean |
equal(Object a,
Object b)
Test the given objects on equality.
|
static <T,D extends T> |
nvl(T value,
D defaultValue)
Returns the first parameter if it's not
null , else the second. |
public static boolean equal(@Nullable Object a, @Nullable Object b)
true
, if either a and b are null or a.equals(b). For arrays the content is compared for equality (deep equals).a
- first object to compare.b
- second object to compare.true
, if a is equal to b or both a and b are null.@NotNull public static <T,D extends T> T nvl(@Nullable T value, @NotNull D defaultValue)
null
, else the second.value
- Value to return if not null
.defaultValue
- Value tor return if first argument is null
- must be not null
.null
, else the second.Copyright © 2021 e-Spirit AG. All Rights Reserved. Build 5.2.210210