Package org.nustaq.kson

Examples of org.nustaq.kson.Kson.writeObject()


            .map("other", OtherPojoConfigItem.class);
        SomePojoConfig result = (SomePojoConfig) kk.readObject( new File("./src/test/kson/test.kson"));
        Assert.assertTrue(result.aList.get(1).nameList[0].equals("Short"));
        Assert.assertTrue(result.untypedList.size() == 2);

        String res = kk.writeObject(result);
        System.out.println(res);

        Object reRead = kk.readObject(res);
        Assert.assertTrue(DeepEquals.deepEquals(result, reRead));
View Full Code Here


        cust.setId(1);
        cust.getPhoneNumbers().add(new KsonPhoneNumber("home", "345 34592-0"));
        cust.getPhoneNumbers().add(new KsonPhoneNumber("work", "345 34592-1"));

        Kson kk = new Kson().map("customer", KsonCustomer.class).map("phone", KsonPhoneNumber.class);
        System.out.println(kk.writeObject(cust));
        System.out.println(kk.writeJSonObject(cust, false));

    }

    @Test
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.