Package siena

Examples of siena.Json.asInt()


 
  public void testFind() {
    Json data = map().put("foo", list(1, 2, list(1, 2, map().put("bar", 1))));
    Json result = data.find("foo", 2, 2, "bar");
    assertNotNull(result);
    assertEquals(1, result.asInt());
   
    // try to call at() in a map
    result = data.find(1);
    assertNull(result);
   
View Full Code Here


    assertTrue(json.isMap());
    assertEquals(2, json.size());
   
    Json foo = json.get("foo");
    assertTrue(foo.isNumber());
    assertEquals(1234, foo.asInt());
   
    Json bar = json.get("bar");
    assertTrue(bar.isBoolean());
    assertEquals(true, bar.asBoolean());
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.