All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.knowm.xchange.empoex.EmpoExUtils Maven / Gradle / Ivy

There is a newer version: 4.3.6
Show newest version
package org.knowm.xchange.empoex;

import java.util.Date;

import org.knowm.xchange.currency.CurrencyPair;

public final class EmpoExUtils {

  public static String toPairString(CurrencyPair currencyPair) {

    return currencyPair.base.getCurrencyCode() + "-" + currencyPair.counter.getCurrencyCode();
  }

  public static CurrencyPair toCurrencyPair(String pairString) {

    String[] currencies = pairString.split("-");
    return new CurrencyPair(currencies[0], currencies[1]);
  }

  public static Date toDate(long unix) {

    return new Date(unix * 1000L);
  }

  public static Date toDate(String dateString) {

    return toDate(Long.parseLong(dateString));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy