BithumbAdapters { public static Ticker adaptTicker(BithumbTicker bithumbTicker, CurrencyPair currencyPair) { return new Ticker.Builder() .currencyPair(currencyPair) .ask(bithumbTicker.getSellPrice()) .bid(bithumbTicker.getBuyPrice()) .high(bithumbTicker.getMaxPrice()) .low(bithumbTicker.getMinPrice()) .last(bithumbTicker.getClosingPrice()) .open(bithumbTicker.getOpeningPrice()) .vwap(bithumbTicker.getAveragePrice()) .volume(bithumbTicker.getUnitsTraded()) .timestamp(new Date(bithumbTicker.getDate())) .build(); } private  BithumbAdapters(); static OrderBook adaptOrderBook(BithumbOrderbook orderbook); static AccountInfo adaptAccountInfo(BithumbAccount account, BithumbBalance balance); static Ticker adaptTicker(BithumbTicker bithumbTicker, CurrencyPair currencyPair); static List<Ticker> adaptTickers(BithumbTickersReturn bithumbTickers); static Trades adaptTransactions(
      List<BithumbTransactionHistory> bithumbTrades, CurrencyPair currencyPair); static Trade adaptTransactionHistory(
      BithumbTransactionHistory trade, CurrencyPair currencyPair); static OpenOrders adaptOrders(List<BithumbOrder> bithumbOrders); static LimitOrder adaptOrder(BithumbOrder order); static UserTrades adaptUserTrades(
      List<BithumbUserTransaction> transactions, CurrencyPair currencyPair); static Order adaptOrderDetail(BithumbOrderDetail order, String id); static CurrencyPair adaptCurrencyPair(String orderCurrency, String paymentCurrency); static final String SEARCH_BUY; static final String SEARCH_SELL; }
@Test public void testAdaptTicker() throws IOException { InputStream is = BithumbAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/bithumb/dto/marketdata/example-ticker.json"); final BithumbTicker bithumbAccount = mapper.readValue(is, BithumbTicker.class); final Ticker ticker = BithumbAdapters.adaptTicker(bithumbAccount, CurrencyPair.BTC_KRW); assertThat(ticker.getOpen()).isEqualTo(new BigDecimal("151300")); assertThat(ticker.getLast()).isEqualTo(new BigDecimal("168900")); assertThat(ticker.getBid()).isEqualTo(new BigDecimal("168800")); assertThat(ticker.getAsk()).isEqualTo(new BigDecimal("168900")); assertThat(ticker.getHigh()).isEqualTo(new BigDecimal("171600")); assertThat(ticker.getLow()).isEqualTo(new BigDecimal("148600")); assertThat(ticker.getVwap()).isEqualTo(new BigDecimal("161373.9643")); assertThat(ticker.getVolume()).isEqualTo(new BigDecimal("294028.02849871")); assertThat(ticker.getTimestamp().getTime()).isEqualTo(1546440237614L); }