/** * Factory method for getting an instance of JSON numeric value * that expresses given unlimited range integer value */ public NumericNode numberNode(BigInteger v) { return BigIntegerNode.valueOf(v); }
public static BigIntegerNode valueOf(BigInteger v) { return new BigIntegerNode(v); }
/** * Factory method for getting an instance of JSON numeric value * that expresses given unlimited range integer value */ public NumericNode numberNode(BigInteger v) { return BigIntegerNode.valueOf(v); }
public static BigIntegerNode valueOf(BigInteger v) { return new BigIntegerNode(v); }
/** * Factory method for getting an instance of JSON numeric value * that expresses given unlimited range integer value */ public NumericNode numberNode(BigInteger v) { return BigIntegerNode.valueOf(v); }
public static BigIntegerNode valueOf(BigInteger v) { return new BigIntegerNode(v); }
/** * Factory method for getting an instance of JSON numeric value * that expresses given unlimited range integer value */ public NumericNode numberNode(BigInteger v) { return BigIntegerNode.valueOf(v); }
public static BigIntegerNode valueOf(BigInteger v) { return new BigIntegerNode(v); }
/** * Factory method for getting an instance of Json numeric value * that expresses given unlimited range integer value */ public NumericNode numberNode(BigInteger v) { return BigIntegerNode.valueOf(v); }
public static BigIntegerNode valueOf(BigInteger v) { return new BigIntegerNode(v); }
@Test public void whenReprIsBigInteger() throws Exception { // given allowingObjectSpecHas(EncodableFacet.class, encodableFacet); allowingObjectSpecCorrespondingClassIs(BigInteger.class); final BigInteger value = BigInteger.valueOf(123); representation = new JsonRepresentation(BigIntegerNode.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); }
@Test public void whenReprIsBigInteger() throws Exception { // given allowingObjectSpecHas(EncodableFacet.class, encodableFacet); allowingObjectSpecCorrespondingClassIs(BigInteger.class); final BigInteger value = BigInteger.valueOf(123); representation = new JsonRepresentation(BigIntegerNode.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); }
@Test public void whenReprIsBigInteger() throws Exception { // given allowingObjectSpecHas(EncodableFacet.class, mockEncodableFacet); allowingObjectSpecCorrespondingClassAndSpecIdIs(BigInteger.class); final BigInteger value = BigInteger.valueOf(123); representation = new JsonRepresentation(BigIntegerNode.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); }