Enum Class OmniCurrencyCode

java.lang.Object
java.lang.Enum<OmniCurrencyCode>
foundation.omni.money.OmniCurrencyCode
All Implemented Interfaces:
Serializable, Comparable<OmniCurrencyCode>, java.lang.constant.Constable

public enum OmniCurrencyCode extends Enum<OmniCurrencyCode>
CurrencyCode for base and popular OMNI currencies Base is OMNI and TOMNI Others are currencies with market cap over 1M and listed on exchanges
  • Enum Constant Details

  • Field Details

  • Method Details

    • values

      public static OmniCurrencyCode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static OmniCurrencyCode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • id

      public CurrencyID id()
    • type

      public PropertyType type()
    • idToCodeString

      public static String idToCodeString(CurrencyID id)
      Generate a currency code string from an Omni CurrencyID
      Parameters:
      id - CurrencyID to convert
      Returns:
      An enumerated code if available, or OMNI_SPT#nnn, or TOMNI_SPT#nnn
    • idToCode

      public static Optional<OmniCurrencyCode> idToCode(CurrencyID id)
      Generate a OmniCurrencyCode for an Omni CurrencyID
      Parameters:
      id - CurrencyID to lookup
      Returns:
      An enumerated code if available, empty otherwise
    • stringToCode

      public static Optional<OmniCurrencyCode> stringToCode(String string)
    • codeToId

      public static CurrencyID codeToId(String codeString)