public class MoreObjects
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static <T> T |
coalesce(T first,
T... other) |
Returns the first object from the given objects that is not
null. |
static boolean |
isDescendantOf(java.lang.Object object,
java.lang.Class<?> clazz) |
Checks whether the given object is an instance of the given class or any of its descendant classes.
|
static boolean |
isInstanceOf(java.lang.Object object,
java.lang.Class<?> clazz) |
Checks whether the given object is an instance of the given class.
|
@SafeVarargs
public static <T> T coalesce(T first,
T... other)
null.
Returns null if there is no such object.public static boolean isDescendantOf(java.lang.Object object,
java.lang.Class<?> clazz)
java.lang.IllegalArgumentException - if clazz is nullpublic static boolean isInstanceOf(java.lang.Object object,
java.lang.Class<?> clazz)
java.lang.IllegalArgumentException - if clazz is null