jdereg / json-io

Convert Java to JSON. Convert JSON to Java. Pretty print JSON. Java JSON serializer. Deep copy Java object graphs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Converting lambda expression to JSON and back

vbutsko opened this issue · comments

Hi there. Faced with problem using json-io. Is it possible to convert lambda function to json and back ? (in my case it even list of lambdas, but I think that amount doesn't matter)

For example I'm trying to convert lambda to json and it's ok, it looks like {"@type":"com.test_project.TestMain$$Lambda$1/333362446"}, where TestMain is a class where lambda is created. But then it's not possible to create object from such json

Do you need the @type info in your output JSON? If you do not, turn off writing of @type to the output by setting the 'TYPE' flag in the options Map fed to the writer.

I will try a test of this to see what happens in the meantime.