// License & terms of use: http://www.unicode.org/copyright.html#License
package com.ibm.icu.impl.number;
-import java.util.Objects;
-
+import com.ibm.icu.impl.Utility;
import com.ibm.icu.number.Grouper;
import com.ibm.icu.number.IntegerWidth;
import com.ibm.icu.number.Notation;
@Override
public int hashCode() {
- return Objects.hash(
+ return Utility.hash(
notation,
unit,
rounder,
@Override
public boolean equals(Object _other) {
MacroProps other = (MacroProps) _other;
- return Objects.equals(notation, other.notation)
- && Objects.equals(unit, other.unit)
- && Objects.equals(rounder, other.rounder)
- && Objects.equals(grouper, other.grouper)
- && Objects.equals(padder, other.padder)
- && Objects.equals(integerWidth, other.integerWidth)
- && Objects.equals(symbols, other.symbols)
- && Objects.equals(unitWidth, other.unitWidth)
- && Objects.equals(sign, other.sign)
- && Objects.equals(decimal, other.decimal)
- && Objects.equals(affixProvider, other.affixProvider)
- && Objects.equals(multiplier, other.multiplier)
- && Objects.equals(rules, other.rules)
- && Objects.equals(loc, other.loc);
+ return Utility.equals(notation, other.notation)
+ && Utility.equals(unit, other.unit)
+ && Utility.equals(rounder, other.rounder)
+ && Utility.equals(grouper, other.grouper)
+ && Utility.equals(padder, other.padder)
+ && Utility.equals(integerWidth, other.integerWidth)
+ && Utility.equals(symbols, other.symbols)
+ && Utility.equals(unitWidth, other.unitWidth)
+ && Utility.equals(sign, other.sign)
+ && Utility.equals(decimal, other.decimal)
+ && Utility.equals(affixProvider, other.affixProvider)
+ && Utility.equals(multiplier, other.multiplier)
+ && Utility.equals(rules, other.rules)
+ && Utility.equals(loc, other.loc);
}
@Override
package com.ibm.icu.number;
import java.math.BigInteger;
-import java.util.Objects;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
+import com.ibm.icu.impl.Utility;
import com.ibm.icu.impl.number.DecimalQuantity;
import com.ibm.icu.impl.number.DecimalQuantity_DualStorageBCD;
import com.ibm.icu.impl.number.MacroProps;
MeasureUnit unit = input.getUnit();
Number number = input.getNumber();
// Use this formatter if possible
- if (Objects.equals(resolve().unit, unit)) {
+ if (Utility.equals(resolve().unit, unit)) {
return format(number);
}
// This mechanism saves the previously used unit, so if the user calls this method with the
// same unit multiple times in a row, they get a more efficient code path.
LocalizedNumberFormatter withUnit = savedWithUnit;
- if (withUnit == null || !Objects.equals(withUnit.resolve().unit, unit)) {
+ if (withUnit == null || !Utility.equals(withUnit.resolve().unit, unit)) {
withUnit = new LocalizedNumberFormatter(this, KEY_UNIT, unit);
savedWithUnit = withUnit;
}