Package org.openhab.core.library.unit
Class CurrencyUnits
java.lang.Object
tech.units.indriya.AbstractSystemOfUnits
org.openhab.core.library.unit.CurrencyUnits
- All Implemented Interfaces:
javax.measure.spi.SystemOfUnits
,tech.uom.lib.common.function.Nameable
@NonNullByDefault
public final class CurrencyUnits
extends tech.units.indriya.AbstractSystemOfUnits
The
CurrencyUnits
defines the UoM system for handling currencies- Author:
- Jan N. Klug - Initial contribution
-
Nested Class Summary
Nested classes/interfaces inherited from class tech.units.indriya.AbstractSystemOfUnits
tech.units.indriya.AbstractSystemOfUnits.Helper
-
Field Summary
Modifier and TypeFieldDescriptionstatic final javax.measure.Unit
<Currency> static final javax.measure.Unit
<EnergyPrice> Fields inherited from class tech.units.indriya.AbstractSystemOfUnits
E, logger, quantityToUnit, units
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static javax.measure.Unit
<Currency> createCurrency
(String symbol, String name) static @Nullable BigDecimal
getExchangeRate
(javax.measure.Unit<Currency> currency) Get the exchange rate for a given currency to the system's base unitstatic javax.measure.spi.SystemOfUnits
getName()
static void
removeUnit
(javax.measure.Unit<Currency> unit) Methods inherited from class tech.units.indriya.AbstractSystemOfUnits
getUnit, getUnit, getUnit, getUnit, getUnits, getUnits
-
Field Details
-
BASE_CURRENCY
-
BASE_ENERGY_PRICE
-
-
Constructor Details
-
CurrencyUnits
public CurrencyUnits()
-
-
Method Details
-
getName
- Specified by:
getName
in interfacetech.uom.lib.common.function.Nameable
- Specified by:
getName
in interfacejavax.measure.spi.SystemOfUnits
- Specified by:
getName
in classtech.units.indriya.AbstractSystemOfUnits
-
addUnit
-
removeUnit
-
getInstance
public static javax.measure.spi.SystemOfUnits getInstance() -
createCurrency
-
getExchangeRate
Get the exchange rate for a given currency to the system's base unit- Parameters:
currency
- the currency- Returns:
- the exchange rate
-