/** * Factory method for getting an instance of JSON numeric value * that expresses given 64-bit integer value */ @Override public NumericNode numberNode(long v) { return LongNode.valueOf(v); }
/** * 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(Long v) { if (v == null) { return nullNode(); } return LongNode.valueOf(v.longValue()); }
@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))); }
/** * Factory method for getting an instance of JSON numeric value * that expresses given 64-bit integer value */ public NumericNode numberNode(long v) { return LongNode.valueOf(v); }
/** * Factory method for getting an instance of JSON numeric value * that expresses given 64-bit integer value */ @Override public NumericNode numberNode(long v) { return LongNode.valueOf(v); }
/** * Factory method for getting an instance of JSON numeric value * that expresses given 64-bit integer value */ @Override public NumericNode numberNode(long v) { return LongNode.valueOf(v); }
/** * Factory method for getting an instance of JSON numeric value * that expresses given 64-bit integer value */ public NumericNode numberNode(long v) { return LongNode.valueOf(v); }
@Override public JsonNode serialize(Long object) { return LongNode.valueOf(object); }
public Atom(long value, long expires) { this(LongNode.valueOf(value), expires); }
public Atom(long value) { this(LongNode.valueOf(value), null); }
public Record set(String key, long v) { map.set(key, LongNode.valueOf(v)); 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(Long v) { if (v == null) { return nullNode(); } return LongNode.valueOf(v.longValue()); }
/** * 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}. */ public ValueNode numberNode(Long value) { return (value == null) ? nullNode() : LongNode.valueOf(value.longValue()); }
/** * 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}. */ public ValueNode numberNode(Long value) { return (value == null) ? nullNode() : LongNode.valueOf(value.longValue()); }
/** * 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(Long value) { if (value == null) { return nullNode(); } return LongNode.valueOf(value.longValue()); }
/** * Create a new replace patch operation. * * @param path The path targeted by this patch operation. The path * must not be {@code null}. * @param value The value(s) to replace. The value(s) must not be {@code null}. * * @return The new replace patch operation. */ public static PatchOperation replace( final Path path, final Long value) { return replace(path, LongNode.valueOf(value)); }
/** * Factory method for getting an instance of JSON numeric value * that expresses given 64-bit integer value */ @Override public NumericNode numberNode(long v) { if (_inIntRange(v)) { return IntNode.valueOf((int) v); } return LongNode.valueOf(v); }
/** * Factory method for getting an instance of JSON numeric value * that expresses given 64-bit integer value */ @Override public NumericNode numberNode(long v) { if (_inIntRange(v)) { return IntNode.valueOf((int) v); } return LongNode.valueOf(v); }
/** * 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(Long value) { if (value == null) { return nullNode(); } long l = value.longValue(); return _inIntRange(l) ? IntNode.valueOf((int) l) : LongNode.valueOf(l); }
/** * 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(Long value) { if (value == null) { return nullNode(); } long l = value.longValue(); return _inIntRange(l) ? IntNode.valueOf((int) l) : LongNode.valueOf(l); }