Package com.fasterxml.jackson.databind

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


                } 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()) {
                    tree.setProperty(name, vf.createValue(value.decimalValue()));
                } else {
                    tree.setProperty(name, vf.createValue(value.asText()));
                }
View Full Code Here


        mapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
        JsonNode jsonRoot = mapper.readTree(responseBodyAsString);
        JsonNode location = jsonRoot.path("results").get(0).path("geometry").path("location");
        JsonNode lat = location.get("lat");
        JsonNode lng = location.get("lng");
        coordinates = new LatLng(lat.asDouble(),lng.asDouble());
      }
    } catch (Exception ex) {
      ex.printStackTrace();
    } finally {
      if(locateAddressGET!=null) locateAddressGET.releaseConnection();
View Full Code Here

                } 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()) {
                    tree.setProperty(name, vf.createValue(value.decimalValue()));
                } else {
                    tree.setProperty(name, vf.createValue(value.asText()));
                }
View Full Code Here

                } 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()) {
                    tree.setProperty(name, vf.createValue(value.decimalValue()));
                } else {
                    tree.setProperty(name, vf.createValue(value.asText()));
                }
View Full Code Here

            throw new ValueSerializationException( "Asked for a Value but found an Object or an Array at "
                                                   + input.getCurrentLocation().toString() );
        }
        if( jsonNode.isDouble() )
        {
            return jsonNode.asDouble();
        }
        if( jsonNode.isLong() )
        {
            return jsonNode.asLong();
        }
View Full Code Here

                } 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()) {
                    tree.setProperty(name, value.decimalValue());
                } else {
                    tree.setProperty(name, value.asText());
                }
View Full Code Here

  Double retrieveSchemaVersion(String collectionName) {
    try {
      SolrJsonResponse response = SolrSchemaRequest.version().process(factory.getSolrServer(collectionName));
      JsonNode node = response.getNode("version");
      return node != null ? node.asDouble() : Double.NaN;
    } catch (SolrServerException e) {
      EXCEPTION_TRANSLATOR.translateExceptionIfPossible(new RuntimeException(e));
    } catch (IOException e) {
      EXCEPTION_TRANSLATOR.translateExceptionIfPossible(new RuntimeException(e));
    } catch (SolrException e) {
View Full Code Here

            value = node.isNull()
                    ? null
                    : node.isBoolean()
                    ? node.asBoolean()
                    : node.isDouble()
                    ? node.asDouble()
                    : node.isLong()
                    ? node.asLong()
                    : node.isInt()
                    ? node.asInt()
                    : node.asText();
View Full Code Here

            } else if (node.isObject()) {
                values.add(((ObjectNode) node).traverse(jp.getCodec()).readValueAs(GuardedString.class));
            } else if (node.isBoolean()) {
                values.add(node.asBoolean());
            } else if (node.isDouble()) {
                values.add(node.asDouble());
            } else if (node.isLong()) {
                values.add(node.asLong());
            } else if (node.isInt()) {
                values.add(node.asInt());
            } else {
View Full Code Here

                    }
                    else if (value.isBoolean()) {
                        call.setBoolean(field, value.asBoolean());
                    }
                    else if (value.isDouble()) {
                        call.setDouble(field, value.asDouble());
                    }
                    else if (value.isInt()) {
                        call.setInt(field, value.asInt());
                    }
                    else if (value.isLong()) {
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.