Code example for BigDecimal

Methods: compareTo

0
    assertEquals(1, object.size());
    assertEquals(number(6), object.get(string("number")));
 
    BigDecimals entity = marshaller.unmarshall(object);
 
    assertTrue(valueOf(6).compareTo(entity.number) == 0);
  } 
 
  @Test 
  public void nativeBigDecimalSuppot2() throws Exception { 
    Json.Object object = marshaller.marshall(new BigDecimals() {{
      this.list = asList(valueOf(6.906), valueOf(-7));
    }}); 
 
    assertEquals(1, object.size());
    Json.Array list = (Json.Array) object.get(string("list"));
    assertEquals(2, list.size());
    assertEquals(number(6.906), list.get(0));
    assertEquals(number(-7), list.get(1));
 
    BigDecimals entity = marshaller.unmarshall(object);