Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.JsonNode.asBoolean()


                    child.remove();
                }
                if (value.isNull()) {
                    tree.removeProperty(name);
                } else if (value.isBoolean()) {
                    tree.setProperty(name, value.asBoolean());
                } else if (value.isLong()) {
                    tree.setProperty(name, value.asLong());
                } else if (value.isDouble()) {
                    tree.setProperty(name, value.asDouble());
                } else if (value.isBigDecimal()) {
View Full Code Here


        if (e.isValueNode()) {

            if (e.isTextual()) {
                return e.asText();
            } else if (e.isBoolean()) {
                return e.asBoolean();
            } else if (e.isInt()) {
                return e.asInt();
            } else if (e.isLong()) {
                return e.asLong();
            } else if (e.isBigDecimal()) {
View Full Code Here

            } else if (valueNode.isArray()) {
                value = jsonNodeToList(valueNode);
            } else if (valueNode.isObject()) {
                value = jsonNodeToMap(valueNode);
            } else if (valueNode.isBoolean()) {
                value = valueNode.asBoolean();
            } else if (valueNode.isInt()) {
                value = valueNode.asInt();
            } else if (valueNode.isLong()) {
                value = valueNode.asLong();
            } else if (valueNode.isDouble()) {
View Full Code Here

    if (propertyNode == null)
      throw new IllegalArgumentException();

    switch (propertyNode.getNodeType()) {
      case BOOLEAN:
        return propertyNode.asBoolean();
      case NULL:
        return null;
      case NUMBER:
        return ((NumericNode) propertyNode).numberValue();
      case POJO:
View Full Code Here

                }
                CoreValueFactory vf = MemoryValueFactory.INSTANCE;
                if (value.isNull()) {
                    tree.removeProperty(name);
                } else if (value.isBoolean()) {
                    tree.setProperty(name, vf.createValue(value.asBoolean()));
                } else if (value.isLong()) {
                    tree.setProperty(name, vf.createValue(value.asLong()));
                } else if (value.isDouble()) {
                    tree.setProperty(name, vf.createValue(value.asDouble()));
                } else if (value.isBigDecimal()) {
View Full Code Here

                }
                CoreValueFactory vf = MemoryValueFactory.INSTANCE;
                if (value.isNull()) {
                    tree.removeProperty(name);
                } else if (value.isBoolean()) {
                    tree.setProperty(name, vf.createValue(value.asBoolean()));
                } else if (value.isLong()) {
                    tree.setProperty(name, vf.createValue(value.asLong()));
                } else if (value.isDouble()) {
                    tree.setProperty(name, vf.createValue(value.asDouble()));
                } else if (value.isBigDecimal()) {
View Full Code Here

      boolean result = true;
      String message = "";
      JsonNode resultNode = node.path("result");
      if (resultNode.isBoolean()) {
        result = resultNode.asBoolean();
        message = node.path("message").asText();
      }
      return new BTERTickers(tickerMap, result, message);
    }
  }
View Full Code Here

      final JsonNode successNode = node.path("success");
      boolean success = true;
      final List<String> errors = new ArrayList<String>();
      if (successNode.isBoolean()) {
        success = successNode.asBoolean();
        final JsonNode errorsNode = node.path("errors");
        if (errorsNode.isArray())
          for (final JsonNode errorNode : errorsNode)
            errors.add(errorNode.asText());
      }
View Full Code Here

    public BitstampBooleanResponse deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException {

      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      if (node.isBoolean()) {
        return new BitstampBooleanResponse(null, node.asBoolean());
      }
      else if (node.get("error") != null) {
        return new BitstampBooleanResponse(node.path("error").asText(), false);
      }
      return new BitstampBooleanResponse("Invalid response from Bitstamp Server.", false);
View Full Code Here

                }
                CoreValueFactory vf = MemoryValueFactory.INSTANCE;
                if (value.isNull()) {
                    tree.removeProperty(name);
                } else if (value.isBoolean()) {
                    tree.setProperty(name, vf.createValue(value.asBoolean()));
                } else if (value.isLong()) {
                    tree.setProperty(name, vf.createValue(value.asLong()));
                } else if (value.isDouble()) {
                    tree.setProperty(name, vf.createValue(value.asDouble()));
                } else if (value.isBigDecimal()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.