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

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

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

Currency.getInstanceNoCreate介绍

[英]Returns the Currency instance for the given currency code only if one already exists.
[中]仅当给定货币代码的货币实例已存在时,才返回该货币实例。

代码示例

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

public static CurrencyPair adaptCurrencyPair(String abucoinsProductID) {
 int indexOf = abucoinsProductID.indexOf('-');
 String base = abucoinsProductID.substring(0, indexOf);
 String counter = abucoinsProductID.substring(indexOf + 1);
 return new CurrencyPair(
   Currency.getInstanceNoCreate(base), Currency.getInstanceNoCreate(counter));
}

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

public static CurrencyPair toCurrencyPair(String pairstring) {
 String[] parts = pairstring.split("_");
 if (parts.length == 2) {
  Currency base = Currency.getInstanceNoCreate(parts[0]);
  Currency counter = Currency.getInstanceNoCreate(parts[1]);
  if (base != null && counter != null) {
   return new CurrencyPair(base, counter);
  }
 }
 return null;
}

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

/** Returns a Currency instance for the given currency code. */
public static Currency getInstance(String currencyCode) {
 Currency currency = getInstanceNoCreate(currencyCode.toUpperCase());
 if (currency == null) {
  return createCurrency(currencyCode.toUpperCase(), null, null);
 } else {
  return currency;
 }
}

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

for (int i = 1; i < currencyPairString.length() - 1; ++i) {
 final Currency tradeCurrency =
   Currency.getInstanceNoCreate(currencyPairString.substring(0, i));
 final Currency priceCurrency = Currency.getInstanceNoCreate(currencyPairString.substring(i));
 if (tradeCurrency != null) {
  if (priceCurrency != null) {

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

public static OpenOrders adaptOpenOrders(
  IndependentReserveOpenOrdersResponse independentReserveOrders) {
 List<LimitOrder> limitOrders = new ArrayList<>();
 List<IndependentReserveOpenOrder> independentReserveOrdersList =
   independentReserveOrders.getIndependentReserveOrders();
 for (IndependentReserveOpenOrder order : independentReserveOrdersList) {
  // getting valid order currency pair
  String primaryAlias = order.getPrimaryCurrencyCode();
  Currency primary = Currency.getInstanceNoCreate(primaryAlias);
  Currency secondary = Currency.getInstanceNoCreate(order.getSecondaryCurrencyCode());
  CurrencyPair currencyPair = new CurrencyPair(primary, secondary);
  LimitOrder limitOrder =
    new LimitOrder(
      adapeOrderType(order.getOrderType()),
      order.getOutstanding(),
      currencyPair,
      order.getOrderGuid(),
      order.getCreatedTimestamp(),
      order.getPrice());
  limitOrders.add(limitOrder);
 }
 return new OpenOrders(limitOrders);
}

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

Currency primary = Currency.getInstanceNoCreate(primaryAlias);
Currency secondary = Currency.getInstanceNoCreate(trade.getSecondaryCurrencyCode());

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

/** Returns a Currency instance for the given currency code. */
public static Currency getInstance(String currencyCode) {
 Currency currency = getInstanceNoCreate(currencyCode.toUpperCase());
 if (currency == null) {
  return createCurrency(currencyCode.toUpperCase(), null, null);
 } else {
  return currency;
 }
}

代码示例来源:origin: ICOnator/ICOnator-backend

private Currency convertCurrencyTypes(CurrencyType currencyType) {
  return Currency.getInstanceNoCreate(currencyType.name());
}

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

for (int i = 1; i < currencyPairString.length() - 1; ++i) {
 final Currency tradeCurrency =
   Currency.getInstanceNoCreate(currencyPairString.substring(0, i));
 final Currency priceCurrency = Currency.getInstanceNoCreate(currencyPairString.substring(i));
 if (tradeCurrency != null) {
  if (priceCurrency != null) {

相关文章