public final class Objects extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(Object o1,
Object o2)
Check that two values are equals:
If both are the same instances (or
null , return true .
If one is null , return false .
Finally, if both are non null , return the result of {code o1.equals(o2)}.
|
static <T> T |
firstNonNull(T val1,
T val2,
T... others)
Returns the first of two given parameters that is not
null . |
static int |
hashCode(Object... values)
Compute
hashCode value from all parameters. |
public static <T> T firstNonNull(T val1, T val2, T... others)
null
.T
- Type of parameters.val1
- First value.val2
- Second value.others
- Other value.null
, second parameter otherwise.public static int hashCode(Object... values)
hashCode
value from all parameters.values
- Parameters.public static boolean equals(Object o1, Object o2)
null
, return true
.null
, return false
.null
, return the result of {code o1.equals(o2)}.o1
- First parameter to check.o2
- Second parameter to check.Copyright © 2015. All Rights Reserved.