I'm using protostuff to convert object of my own class to JSON and vice versa. There is java 8 and lambdas. Convert to JSON file like:
LinkedBuffer buffer = LinkedBuffer.allocate(2048);
Schema schema = RuntimeSchema.getSchema(obj.getClass());
boolean numeric = false;
byte[] json = JsonIOUtil.toByteArray(obj, schema, numeric, buffer);
Files.write(file, json);
Convert from JSON to obj:
Schema<MyClass> schema = RuntimeSchema.getSchema(MyClass.class);
Path path = Paths.get("path");
byte[] as = Files.readAllBytes(path);
MyClass mc = schema.newMessage();
JsonIOUtil.mergeFrom(as, mc, schema, false);
And when I'm trying to convert JSON to obj a have an exception:
Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: com.test.Blabla$$Lambda$4/1699679644
I think lambda is a problem. Can I convert classes with it?
Object has a filed:
private final Function<,> name;