public class Objects extends Object
Modifier and Type | Field and Description |
---|---|
static Double |
ZERO_DOUBLE
The zero double.
|
Constructor and Description |
---|
Objects() |
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(Object a,
Object b)
Tests whether two objects are equals.
|
public static final Double ZERO_DOUBLE
public static final boolean equals(Object a, Object b)
It takes care of the null case. Thus, it is helpful to implement Object.equals.
Notice: it uses compareTo if BigDecimal is found. So, in this case, a.equals(b) might not be the same as Objects.equals(a, b).
If both a and b are Object[], they are compared item-by-item.
Copyright © 2020. All rights reserved.