diff --git a/bundles/org.openhab.core/src/main/java/org/openhab/core/library/unit/CurrencyUnit.java b/bundles/org.openhab.core/src/main/java/org/openhab/core/library/unit/CurrencyUnit.java index d2a144ecb4..babfa79471 100644 --- a/bundles/org.openhab.core/src/main/java/org/openhab/core/library/unit/CurrencyUnit.java +++ b/bundles/org.openhab.core/src/main/java/org/openhab/core/library/unit/CurrencyUnit.java @@ -98,10 +98,12 @@ public final class CurrencyUnit extends AbstractUnit { this.name = name; } + @Override public String getName() { return name; } + @Override public @Nullable String getSymbol() { return symbol; } @@ -151,41 +153,6 @@ public final class CurrencyUnit extends AbstractUnit { "Could not get factor for converting " + this.getName() + " to " + that.getName()); } - public final Unit multiply(@NonNullByDefault({}) Unit that) { - return that.equals(ONE) ? this : ProductUnit.ofProduct(this, that); - } - - @Override - public final Unit inverse() { - return ProductUnit.ofQuotient(ONE, this); - } - - @Override - public final Unit divide(@NonNullByDefault({}) Number divisor) { - if (Calculus.currentNumberSystem().isOne(divisor)) { - return this; - } - BigDecimal factor = BigDecimal.ONE.divide(new BigDecimal(divisor.toString()), MathContext.DECIMAL128); - return transform(MultiplyConverter.of(factor)); - } - - @Override - public final Unit divide(@NonNullByDefault({}) Unit that) { - return this.multiply(that.inverse()); - } - - @Override - public final Unit root(int n) { - if (n > 0) { - return ProductUnit.ofRoot(this, n); - } else if (n == 0) { - throw new ArithmeticException("Root's order of zero"); - } else { - // n < 0 - return ONE.divide(this.root(-n)); - } - } - @Override public Unit pow(int n) { if (n > 0) {