public class CryptoTradeTickersDeserializer extends JsonDeserializer<Map<CurrencyPair, CryptoTradeTicker>> {
@Override
public Map<CurrencyPair, CryptoTradeTicker> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
final ObjectCodec oc = jp.getCodec();
final JsonNode rootNode = oc.readTree(jp);
final Map<CurrencyPair, CryptoTradeTicker> tickers = new HashMap<CurrencyPair, CryptoTradeTicker>();
if (rootNode.size() == 1) {
final ObjectNode dataNode = (ObjectNode) rootNode.get(0);
final Iterator<Entry<String, JsonNode>> tickersArray = dataNode.fields();