Skip to content
This repository has been archived by the owner on Dec 3, 2020. It is now read-only.

How to deserialize Kotlin delegates #34

Open
Humberd opened this issue Oct 14, 2017 · 0 comments
Open

How to deserialize Kotlin delegates #34

Humberd opened this issue Oct 14, 2017 · 0 comments

Comments

@Humberd
Copy link

Humberd commented Oct 14, 2017

I have this class:

class Project {
    val nameProperty = SimpleStringProperty("foobar")
    val name by nameProperty
}

I use Fx-GSON library to serialize JavaFx Properties.

When I serialize it to JSON I get this:

{
    "nameProperty": "foobar",
    "name$delegate": "foobar"
}

But when I deserialize it back to the object of type Project the name and nameProperty are 2 different objects.

How to make name property delegate to the new nameProperty?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant