public class Objects extends Object
| Constructor and Description |
|---|
Objects() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
bothNullOrEqual(Object o1,
Object o2) |
static <T> T |
castIfInstance(Object o,
Class<T> c)
Conditional casting, useful for equals() implementations using instanceof
|
static <T> T |
castIfSameClass(Object o,
Class<T> c)
Conditional casting, useful for typical equals() implementations
|
public static <T> T castIfSameClass(Object o, Class<T> c)
T - The generic type of the target classo - The other objectc - The class to check forpublic static <T> T castIfInstance(Object o, Class<T> c)
T - The generic type of the target classo - The other objectc - The class to check forCopyright © 2017. All rights reserved.