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

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addUnit(javax.measure.Unit<Currency> unit)
     
    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 unit
    static javax.measure.spi.SystemOfUnits
     
     
    static void
    removeUnit(javax.measure.Unit<Currency> unit)
     

    Methods inherited from class tech.units.indriya.AbstractSystemOfUnits

    getUnit, getUnit, getUnit, getUnit, getUnits, getUnits

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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
  • 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