Artifact Content
Not logged in

Artifact b1fc1036ff4112515780370e3034005747c7fc8d:


package org.interledger.ilp.ledger;

import java.util.Currency;
import javax.money.CurrencyUnit;
import javax.money.Monetary;

/**
 * Common used currencies
 *
 * @author mrmx
 */
// TODO:(0) Recheck ussage of this class.
public enum Currencies {
    EURO("EUR"),
    US_DOLLAR("USD"),
    POUND("GBP"),
    YEN("JPY"),
    YUAN("CNY");

    private String code;

    private Currencies(String code) {
        this.code = code;
    }

    public String code() {
        return code;
    }

    public String getCode() {
        return code;
    }

    public Currency toCurrency() {
        return Currency.getInstance(code);
    }

    public CurrencyUnit toCurrencyUnit() {
        return Monetary.getCurrency(code);
    }
}