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