我从 Binance 获取返回响应的数据列表,如何访问响应正文的值?
private Closeable candleStick(){
BinanceApiWebSocketClient client = BinanceApiClientFactory.newInstance().newWebSocketClient();
return client.onCandlestickEvent("btcusdt", CandlestickInterval.FIVE_MINUTES, new BinanceApiCallback<com.binance.api.client.domain.event.CandlestickEvent>() {
@Override
public void onResponse(com.binance.api.client.domain.event.CandlestickEvent response) {
System.out.println(response);
}
});
}
响应具有诸如等值response.getHigh(), response.getLow()
。如何以另一种方法访问这些值。它
private String show() throws IOException {
Double high = candleStick().getHigh() //didn't work as the method returns a closeable object.
}