I'm getting a list of data from Binance that returns a response, how do I access the values of the response body?
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);
}
});
}
The response has values like response.getHigh(), response.getLow()
, etc. How do I access these values in another method. It
private String show() throws IOException {
Double high = candleStick().getHigh() //didn't work as the method returns a closeable object.
}