/** * 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); }
/** * 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}. * * @since 1.9 */ public ValueNode numberNode(Long value) { return (value == null) ? nullNode() : LongNode.valueOf(value.longValue()); }
/** * 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); }
/** * 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}. * * @since 1.9 */ public ValueNode numberNode(Long value) { return (value == null) ? nullNode() : LongNode.valueOf(value.longValue()); }
/** * 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 */ 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); }
/** * 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}. * * @since 1.9 */ 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}. * * @since 1.9 */ public ValueNode numberNode(Long value) { return (value == null) ? nullNode() : LongNode.valueOf(value.longValue()); }
private void whenReprIsLong(final Class<?> correspondingClass) { // given allowingObjectSpecHas(EncodableFacet.class, encodableFacet); allowingObjectSpecCorrespondingClassIs(correspondingClass); final long value = 1234567890L; representation = new JsonRepresentation(LongNode.valueOf(value)); context.checking(new Expectations() { { one(encodableFacet).fromEncodedString("" + value); will(returnValue(objectAdapter)); } }); // when final ObjectAdapter adapter = jsonValueEncoder.asAdapter(objectSpec, representation); // then assertSame(objectAdapter, adapter); }
private void whenReprIsLong(final Class<?> correspondingClass) { // given allowingObjectSpecHas(EncodableFacet.class, mockEncodableFacet); allowingObjectSpecCorrespondingClassAndSpecIdIs(correspondingClass); final long value = 1234567890L; representation = new JsonRepresentation(LongNode.valueOf(value)); context.checking(new Expectations() { { oneOf(mockAdapterManager).adapterFor(value); will(returnValue(mockObjectAdapter)); } }); // when final ObjectAdapter adapter = JsonValueEncoder.asAdapter(mockObjectSpec, representation, null); // then assertSame(mockObjectAdapter, adapter); }
private void whenReprIsLong(final Class<?> correspondingClass) { // given allowingObjectSpecHas(EncodableFacet.class, encodableFacet); allowingObjectSpecCorrespondingClassIs(correspondingClass); final long value = 1234567890L; representation = new JsonRepresentation(LongNode.valueOf(value)); context.checking(new Expectations() { { one(encodableFacet).fromEncodedString("" + value); will(returnValue(objectAdapter)); } }); // when final ObjectAdapter adapter = jsonValueEncoder.asAdapter(objectSpec, representation); // then assertSame(objectAdapter, adapter); }