Package com.esotericsoftware.kryo.serializers

Examples of com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer


    TestClass object1 = new TestClass();
    object1.child = new TestClass();
    object1.other = new AnotherClass();
    object1.other.value = "meow";

    CompatibleFieldSerializer serializer = new CompatibleFieldSerializer(kryo, TestClass.class);
    serializer.removeField("text");
    kryo.register(TestClass.class, serializer);
    kryo.register(AnotherClass.class, new CompatibleFieldSerializer(kryo, AnotherClass.class));
    roundTrip(74, 74, object1);

    kryo.register(TestClass.class, new CompatibleFieldSerializer(kryo, TestClass.class));
    Object object2 = kryo.readClassAndObject(input);
    assertEquals(object1, object2);
  }
View Full Code Here


  public void testRemovedField () throws FileNotFoundException {
    TestClass object1 = new TestClass();
    object1.child = new TestClass();

    kryo.register(TestClass.class, new CompatibleFieldSerializer(kryo, TestClass.class));
    roundTrip(88, 88, object1);

    CompatibleFieldSerializer serializer = new CompatibleFieldSerializer(kryo, TestClass.class);
    serializer.removeField("text");
    kryo.register(TestClass.class, serializer);
    Object object2 = kryo.readClassAndObject(input);
    assertEquals(object1, object2);
  }
View Full Code Here

TOP

Related Classes of com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer

Copyright © 2018 www.massapicom. 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.