Refine search
@Override public CoinbaseCurrency deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectCodec oc = jp.getCodec(); JsonNode node = oc.readTree(jp); String name = node.get("name").asText(); String id = node.get("id").asText(); return new CoinbaseCurrency(name, id); } }
@Override public NamespaceBinding deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectMapper mapper = (ObjectMapper)jp.getCodec(); JsonNode node = mapper.readTree(jp); String name = node.get("name").asText(); String session = node.get("session").asText(); Boolean defined = node.get("defined").asBoolean(); JsonNode o = node.get("value"); Object obj = objectSerializerProvider.get().deserialize(o, mapper); return new NamespaceBinding(name,session,obj,defined); } }
@Override public QuadrigaCxDepositAddress deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); if (node.get("error") != null) { return new QuadrigaCxDepositAddress(node.path("error").asText(), ""); } return new QuadrigaCxDepositAddress(null, node.asText()); } }
@Override public BitsoDepositAddress deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); if (node.get("error") != null) { return new BitsoDepositAddress(node.path("error").asText(), ""); } return new BitsoDepositAddress(null, node.asText()); } }
@Override public String deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); if (node.isTextual()) { return node.textValue(); } else if (node.isObject()) { JsonNode allNode = node.get("__all__"); if (allNode != null && allNode.isArray()) { StringBuilder buf = new StringBuilder(); for (JsonNode msgNode : allNode) { buf.append(msgNode.textValue()); buf.append(","); } return buf.length() > 0 ? buf.substring(0, buf.length() - 1) : buf.toString(); } return node.toString(); } return null; } }
@Override public LedgerType deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); String ledgerTypeString = node.textValue(); return fromString(ledgerTypeString); } }
/** * Deserialize an AccessControlList object. * @param jsonParser the json parser * @param deserializationContext deserializationcontext * @return * @throws IOException * @throws JsonProcessingException */ @Override public AccessControlList deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { JsonNode node = jsonParser.getCodec().readTree(jsonParser); String owner = node.get(OWNER_FIELD).asText(); String owningGroup = node.get(OWNING_GROUP_FIELD).asText(); List<String> stringEntries = new ArrayList<>(); Iterator<JsonNode> nodeIterator = node.get(STRING_ENTRY_FIELD).elements(); while (nodeIterator.hasNext()) { stringEntries.add(nodeIterator.next().asText()); } return AccessControlList.fromStringEntries(owner, owningGroup, stringEntries); } }
@Override public BitmexTickDirection deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); String tickDirectionString = node.textValue(); return fromString(tickDirectionString); } }
@Override public String deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); if (node.isTextual()) { return node.textValue(); } else if (node.isObject()) { JsonNode allNode = node.get("__all__"); if (allNode != null && allNode.isArray()) { StringBuffer buf = new StringBuffer(); for (JsonNode msgNode : allNode) { buf.append(msgNode.textValue()); buf.append(","); } return buf.length() > 0 ? buf.substring(0, buf.length() - 1) : buf.toString(); } return node.toString(); } return null; } }
@Override public CoinbaseButtonStyle deserialize(JsonParser jsonParser, final DeserializationContext ctxt) throws IOException, JsonProcessingException { final ObjectCodec oc = jsonParser.getCodec(); final JsonNode node = oc.readTree(jsonParser); final String jsonString = node.textValue(); return FROM_STRING_HELPER.fromJsonString(jsonString); } }
@Override public String deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); if (node.isTextual()) { return node.textValue(); } else if (node.isObject()) { JsonNode allNode = node.get("__all__"); if (allNode != null && allNode.isArray()) { StringBuffer buf = new StringBuffer(); for (JsonNode msgNode : allNode) { buf.append(msgNode.textValue()); buf.append(","); } return buf.length() > 0 ? buf.substring(0, buf.length() - 1) : buf.toString(); } return node.toString(); } return null; } }
@Override public CoinbaseTransactionStatus deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); String jsonString = node.textValue(); return FROM_STRING_HELPER.fromJsonString(jsonString); } }
@Override public CoinMarketCapQuote deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectCodec oc = jp.getCodec(); JsonNode node = oc.readTree(jp); if (node.isObject()) { BigDecimal price = new BigDecimal(node.get("price").asDouble()); BigDecimal volume24h = new BigDecimal(node.get("volume_24h").asDouble()); BigDecimal marketCap = new BigDecimal(node.get("market_cap").asDouble()); // TODO use these to create CoinMarketCapHistoricalSpotPrice instances BigDecimal pctChange1h = new BigDecimal(node.get("percent_change_1h").asDouble()); BigDecimal pctChange24h = new BigDecimal(node.get("percent_change_24h").asDouble()); BigDecimal pctChange7d = new BigDecimal(node.get("percent_change_7d").asDouble()); return new CoinMarketCapQuote( price, volume24h, marketCap, pctChange1h, pctChange24h, pctChange7d); } return null; } }
@Override public KrakenOrderStatus deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); String orderStatusString = node.textValue(); return fromString(orderStatusString); } }
@Override public User deserialize(JsonParser parser, DeserializationContext context) throws IOException, JsonProcessingException { JsonNode node = parser.getCodec().readTree(parser); String userName = node.get("user-name").asText(); User user = new User(); user.setUserName(userName); return user; } }