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

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

本文整理了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

public static Currency adaptCurrencyToExchange(Currency currency) {
 if (currency == Currency.BTC) {
  return currency.getIso4217Currency();
 }
 return currency;
}

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

public static String getKrakenCurrencyCode(Currency currency) {
 if (currency.getIso4217Currency() != null) {
  currency = currency.getIso4217Currency();
 }
 String krakenCode = assetsMapReverse.get(currency);
 if (krakenCode == null) {
  throw new ExchangeException("Kraken does not support the currency code " + currency);
 }
 return krakenCode;
}

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

public static String getBitmexCurrencyCode(Currency currency) {
 if (currency.getIso4217Currency() != null) {
  currency = currency.getIso4217Currency();
 }
 String bitmexCode = assetsMap.inverse().get(currency);
 if (bitmexCode == null) {
  throw new ExchangeException("Bitmex does not support the currency code " + currency);
 }
 return bitmexCode;
}

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

public static String getKrakenCurrencyCode(Currency currency) {
 if (currency.getIso4217Currency() != null) {
  currency = currency.getIso4217Currency();
 }
 String krakenCode = assetsMapReverse.get(currency);
 if (krakenCode == null) {
  throw new ExchangeException("Kraken does not support the currency code " + currency);
 }
 return krakenCode;
}

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

public static String getBitmexCurrencyCode(Currency currency) {
 if (currency.getIso4217Currency() != null) {
  currency = currency.getIso4217Currency();
 }
 String bitmexCode = assetsMap.inverse().get(currency);
 if (bitmexCode == null) {
  throw new ExchangeException("Bitmex does not support the currency code " + currency);
 }
 return bitmexCode;
}

相关文章