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, Christoph Weitkamp - Added price per volume
  • Field Details

    • BASE_CURRENCY

      public static final javax.measure.Unit<Currency> BASE_CURRENCY
    • BASE_ENERGY_PRICE

      public static final javax.measure.Unit<EnergyPrice> BASE_ENERGY_PRICE
    • PRICE_PER_LITRE

      public static final javax.measure.Unit<VolumePrice> PRICE_PER_LITRE
    • PRICE_PER_CUBIC_METRE

      public static final javax.measure.Unit<VolumePrice> PRICE_PER_CUBIC_METRE
    • PRICE_PER_GALLON_LIQUID_US

      public static final javax.measure.Unit<VolumePrice> PRICE_PER_GALLON_LIQUID_US
  • Constructor Details

    • CurrencyUnits

      public CurrencyUnits()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface tech.uom.lib.common.function.Nameable
      Specified by:
      getName in interface javax.measure.spi.SystemOfUnits
      Specified by:
      getName in class tech.units.indriya.AbstractSystemOfUnits
    • addUnit

      public static void addUnit(javax.measure.Unit<Currency> unit)
    • removeUnit

      public static void removeUnit(javax.measure.Unit<Currency> unit)
    • getInstance

      public static javax.measure.spi.SystemOfUnits getInstance()
    • createCurrency

      public static javax.measure.Unit<Currency> createCurrency(String symbol, String name)
    • getExchangeRate

      public static @Nullable BigDecimal getExchangeRate(javax.measure.Unit<Currency> currency)
      Get the exchange rate for a given currency to the system's base unit
      Parameters:
      currency - the currency
      Returns:
      the exchange rate