public static DoubleNode valueOf(double v) { return new DoubleNode(v); }
/** * Factory method for getting an instance of JSON numeric value * that expresses given 64-bit floating point value */ @Override public NumericNode numberNode(double v) { return DoubleNode.valueOf(v); }
@Override public BigInteger bigIntegerValue() { return decimalValue().toBigInteger(); }
public void add(Object obj){ DoubleNode newNode = new DoubleNode(obj); newNode.setPrev(getLast()); super.add((Node)newNode); }
mvalue = iterateObject(n); } else if (value instanceof Double) { DoubleNode n = new DoubleNode((Double) value); // (Node) value; nvalue = n.numberValue(); } else if (value instanceof DoubleNode) { DoubleNode n = (DoubleNode) value; n.asDouble(); DoubleNode nn = new DoubleNode(n.asDouble()); // (Node) value; nvalue = nn.numberValue(); } else if (value instanceof Integer) { IntNode n = new IntNode((Integer) value); // (Node) value;
@Override public void serialize(DoubleNode value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException { gen.writeRaw(format(value.asDouble())); } }
@Override public void serialize(DoubleNode value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException { gen.writeRaw(format(value.asDouble())); } }
/** * Sets the expected value for this condition. * * @param expectedValue Expected value. * @return This object for method chaining. */ public Builder expectedValue(double expectedValue) { this.expectedValue = new DoubleNode(expectedValue); return this; }
/** * Alternate factory method that will handle wrapper value, which may * be null. * Due to possibility of null, returning type is not guaranteed to be * {@link NumericNode}, but just {@link ValueNode}. */ @Override public ValueNode numberNode(Double value) { return (value == null) ? nullNode() : DoubleNode.valueOf(value.doubleValue()); }
@Override public BigInteger bigIntegerValue() { return decimalValue().toBigInteger(); }
} else { DoubleNode dd = (DoubleNode) test; bidFloor = dd.asDouble();
/** * Sets the expected value for this condition. * * @param expectedValue Expected value. * @return This object for method chaining. */ public Builder expectedValue(double expectedValue) { this.expectedValue = new DoubleNode(expectedValue); return this; }
@Test public void testToJsonNode() { assertEquals(null, toJsonNode(null)); assertEquals(NullNode.getInstance(), toJsonNode(JsonProperties.NULL_VALUE)); assertEquals(BooleanNode.TRUE, toJsonNode(true)); assertEquals(IntNode.valueOf(1), toJsonNode(1)); assertEquals(LongNode.valueOf(2), toJsonNode(2L)); assertEquals(FloatNode.valueOf(1.0f), toJsonNode(1.0f)); assertEquals(DoubleNode.valueOf(2.0), toJsonNode(2.0)); assertEquals(TextNode.valueOf("\u0001\u0002"), toJsonNode(new byte[] { 1, 2 })); assertEquals(TextNode.valueOf("a"), toJsonNode("a")); assertEquals(TextNode.valueOf("UP"), toJsonNode(Direction.UP)); ArrayNode an = JsonNodeFactory.instance.arrayNode(); an.add(1); assertEquals(an, toJsonNode(Collections.singletonList(1))); ObjectNode on = JsonNodeFactory.instance.objectNode(); on.put("a", 1); assertEquals(on, toJsonNode(Collections.singletonMap("a", 1))); }
@Override public BigInteger bigIntegerValue() { return decimalValue().toBigInteger(); }
/** * Sets the expected value for this condition. * * @param expectedValue Expected value. * @return This object for method chaining. */ public Builder expectedValue(double expectedValue) { this.expectedValue = new DoubleNode(expectedValue); return this; }
} else if (value.getN() != null) { double v = Double.parseDouble(value.getN()); return DoubleNode.valueOf(v); } else if (value.getL() != null) { ArrayNode arr = JsonHelper.jsonArray();
@Override public BigInteger bigIntegerValue() { return decimalValue().toBigInteger(); }
/** * Sets the expected value for this condition. * * @param expectedValue Expected value. * @return This object for method chaining. */ public Builder expectedValue(double expectedValue) { this.expectedValue = new DoubleNode(expectedValue); return this; }
/** * Factory method for getting an instance of JSON numeric value * that expresses given 64-bit floating point value */ public NumericNode numberNode(double v) { return DoubleNode.valueOf(v); }