public final class Utils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <E> boolean |
areDisjoint(java.util.Set<E> setOne,
java.util.Set<E> setTwo)
Checks if two
Set are disjoint. |
static <T> T |
checkNotNull(T reference)
Checks if the object is null.
|
static <T> T |
checkNotNull(T reference,
java.lang.Object errorMessage)
Checks if the object is null.
|
@Nonnull
public static <T> T checkNotNull(T reference,
@Nullable
java.lang.Object errorMessage)
T - the value typereference - the object whose nullability has to be checkederrorMessage - the message to use with the NullPointerExceptionjava.lang.NullPointerException - if the object is nullpublic static <E> boolean areDisjoint(java.util.Set<E> setOne,
java.util.Set<E> setTwo)
Set are disjoint. Returns true if the sets don't have a single common element. Also returns
true if either of the sets is null.E - the value type contained within the setssetOne - the first setsetTwo - the second set@Nonnull public static <T> T checkNotNull(T reference)
T - the value typereference - the object whose nullability has to be checkedjava.lang.NullPointerException - if the object is null