org.knowm.xchange.currency.Currency.getIso4217Currency()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中org.knowm.xchange.currency.Currency.getIso4217Currency()方法的一些代码示例,展示了Currency.getIso4217Currency()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Currency.getIso4217Currency()方法的具体详情如下:
包路径:org.knowm.xchange.currency.Currency
类名称:Currency
方法名:getIso4217Currency

Currency.getIso4217Currency介绍

[英]Gets the equivalent object with an ISO 4217 code, or if none a code which looks ISO compatible (starts with an X), or the constructed currency code if neither exist.
[中]获取具有ISO 4217代码的等效对象,如果没有,则获取看起来与ISO兼容的代码(以X开头),如果两者都不存在,则获取构造的货币代码。

代码示例

代码示例来源:origin: knowm/XChange

  1. public static Currency adaptCurrencyToExchange(Currency currency) {
  2. if (currency == Currency.BTC) {
  3. return currency.getIso4217Currency();
  4. }
  5. return currency;
  6. }

代码示例来源:origin: knowm/XChange

  1. public static String getKrakenCurrencyCode(Currency currency) {
  2. if (currency.getIso4217Currency() != null) {
  3. currency = currency.getIso4217Currency();
  4. }
  5. String krakenCode = assetsMapReverse.get(currency);
  6. if (krakenCode == null) {
  7. throw new ExchangeException("Kraken does not support the currency code " + currency);
  8. }
  9. return krakenCode;
  10. }

代码示例来源:origin: knowm/XChange

  1. public static String getBitmexCurrencyCode(Currency currency) {
  2. if (currency.getIso4217Currency() != null) {
  3. currency = currency.getIso4217Currency();
  4. }
  5. String bitmexCode = assetsMap.inverse().get(currency);
  6. if (bitmexCode == null) {
  7. throw new ExchangeException("Bitmex does not support the currency code " + currency);
  8. }
  9. return bitmexCode;
  10. }

代码示例来源:origin: org.knowm.xchange/xchange-kraken

  1. public static String getKrakenCurrencyCode(Currency currency) {
  2. if (currency.getIso4217Currency() != null) {
  3. currency = currency.getIso4217Currency();
  4. }
  5. String krakenCode = assetsMapReverse.get(currency);
  6. if (krakenCode == null) {
  7. throw new ExchangeException("Kraken does not support the currency code " + currency);
  8. }
  9. return krakenCode;
  10. }

代码示例来源:origin: org.knowm.xchange/xchange-bitmex

  1. public static String getBitmexCurrencyCode(Currency currency) {
  2. if (currency.getIso4217Currency() != null) {
  3. currency = currency.getIso4217Currency();
  4. }
  5. String bitmexCode = assetsMap.inverse().get(currency);
  6. if (bitmexCode == null) {
  7. throw new ExchangeException("Bitmex does not support the currency code " + currency);
  8. }
  9. return bitmexCode;
  10. }

相关文章