Examples of asDouble()


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

            } else if (valueNode.isInt()) {
                value = valueNode.asInt();
            } else if (valueNode.isLong()) {
                value = valueNode.asLong();
            } else if (valueNode.isDouble()) {
                value = valueNode.asDouble();
            } else {
                value = valueNode;
            }
            values[i] = value;
        }
View Full Code Here

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

    private static double doubleValue(final JsonNode json, final String fieldName) {
        if (json != null) {
            final JsonNode value = json.get(fieldName);

            if (value != null) {
                return value.asDouble(-1.0);
            }
        }
        return -1.0;
    }
View Full Code Here

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

            // Convert JSON containers to Strings, and pick a suitable number representation.
            final Object fieldValue;
            if (value.isContainerNode()) {
                fieldValue = value.toString();
            } else if (value.isFloatingPointNumber()) {
                fieldValue = value.asDouble();
            } else if (value.isIntegralNumber()) {
                fieldValue = value.asLong();
            } else if (value.isNull()) {
                log.debug("Field [{}] is NULL. Skipping.", key);
                continue;
View Full Code Here

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

Examples of com.github.jsonj.JsonPrimitive.asDouble()

@Test
public class JsonBuilderTest {
    public void shouldConstructInteger() {
        JsonPrimitive p1 = primitive(1234);
        double d1 = p1.asDouble();
        JsonPrimitive p2 = primitive(d1);
        Assert.assertEquals(1234, p2.asInt());
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
View Full Code Here

Examples of com.google.enterprise.connector.dctm.dfcwrap.IValue.asDouble()

        switch (dataType) {
          case IAttr.DM_BOOLEAN:
            values.add(Value.getBooleanValue(val.asBoolean()));
            break;
          case IAttr.DM_DOUBLE:
            values.add(Value.getDoubleValue(val.asDouble()));
            break;
          case IAttr.DM_ID:
            // TODO: Should we check for null here?
            values.add(Value.getStringValue(val.asId().getId()));
            break;
View Full Code Here

Examples of com.hazelcast.com.eclipsesource.json.JsonValue.asDouble()

    }

    public static double getDouble(JsonObject object, String field) {
        final JsonValue value = object.get(field);
        throwExceptionIfNull(value, field);
        return value.asDouble();
    }

    public static double getDouble(JsonObject object, String field, double defaultValue) {
        final JsonValue value = object.get(field);
        if (value == null) {
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OType.asDouble()

        throw new OValidationException("The field '" + iRecord.getClassName() + "." + p.getName() + "' is minor than " + min);
      else if (p.getType().equals(OType.LONG) && (fieldValue != null && type.asLong(fieldValue) < Long.parseLong(min)))
        throw new OValidationException("The field '" + iRecord.getClassName() + "." + p.getName() + "' is minor than " + min);
      else if (p.getType().equals(OType.FLOAT) && (fieldValue != null && type.asFloat(fieldValue) < Float.parseFloat(min)))
        throw new OValidationException("The field '" + iRecord.getClassName() + "." + p.getName() + "' is minor than " + min);
      else if (p.getType().equals(OType.DOUBLE) && (fieldValue != null && type.asDouble(fieldValue) < Double.parseDouble(min)))
        throw new OValidationException("The field '" + iRecord.getClassName() + "." + p.getName() + "' is minor than " + min);
      else if (p.getType().equals(OType.DATE)) {
        try {
          if (fieldValue != null
              && ((Date) fieldValue).before(iRecord.getDatabase().getStorage().getConfiguration().getDateFormatInstance()
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OType.asDouble()

        throw new OValidationException("The field '" + iRecord.getClassName() + "." + p.getName() + "' is major than " + max);
      else if (p.getType().equals(OType.LONG) && (fieldValue != null && type.asLong(fieldValue) > Long.parseLong(max)))
        throw new OValidationException("The field '" + iRecord.getClassName() + "." + p.getName() + "' is major than " + max);
      else if (p.getType().equals(OType.FLOAT) && (fieldValue != null && type.asFloat(fieldValue) > Float.parseFloat(max)))
        throw new OValidationException("The field '" + iRecord.getClassName() + "." + p.getName() + "' is major than " + max);
      else if (p.getType().equals(OType.DOUBLE) && (fieldValue != null && type.asDouble(fieldValue) > Double.parseDouble(max)))
        throw new OValidationException("The field '" + iRecord.getClassName() + "." + p.getName() + "' is major than " + max);
      else if (p.getType().equals(OType.DATE)) {
        try {
          if (fieldValue != null
              && ((Date) fieldValue).before(iRecord.getDatabase().getStorage().getConfiguration().getDateFormatInstance()
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OType.asDouble()

        throw new OValidationException("The field " + iRecord.getClassName() + "." + p.getName() + " is minor than " + min);
      else if (p.getType().equals(OType.LONG) && (fieldValue != null && type.asLong(fieldValue) < Long.parseLong(min)))
        throw new OValidationException("The field " + iRecord.getClassName() + "." + p.getName() + " is minor than " + min);
      else if (p.getType().equals(OType.FLOAT) && (fieldValue != null && type.asFloat(fieldValue) < Float.parseFloat(min)))
        throw new OValidationException("The field " + iRecord.getClassName() + "." + p.getName() + " is minor than " + min);
      else if (p.getType().equals(OType.DOUBLE) && (fieldValue != null && type.asDouble(fieldValue) < Double.parseDouble(min)))
        throw new OValidationException("The field " + iRecord.getClassName() + "." + p.getName() + " is minor than " + min);
      else if (p.getType().equals(OType.DATE)) {
        try {
          if (fieldValue != null
              && ((Date) fieldValue).before(iRecord.getDatabase().getStorage().getConfiguration().getDateTimeFormatInstance()
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.