A way to serialize and deserialize LDUser #199
Description
Is your feature request related to a problem? Please describe.
I would like to have the ability use Gson or other json serialization library in order to serialize/deserialize LDUser
and transfer it between microservices.
Describe the solution you'd like
I think that as you already have Gson serialization, just need deserialization that takes the created LDUser and
set LDValue null in case that the specific field is null
Additional context
I tried just to use LDUser ldUser = GSON.fromJson(ldUserStr, LDUser.class);
but then I receive NPE with the following stacktrace:
java.lang.NullPointerException: null
at com.launchdarkly.client.LDUser$UserAdapterWithPrivateAttributeBehavior.write(LDUser.java:201)
at com.launchdarkly.client.LDUser$UserAdapterWithPrivateAttributeBehavior.write(LDUser.java:180)
at com.google.gson.Gson.toJson(Gson.java:704)
at com.launchdarkly.client.EventOutputFormatter.writeUser(EventOutputFormatter.java:186)
at com.launchdarkly.client.EventOutputFormatter.writeOutputEvent(EventOutputFormatter.java:81)
at com.launchdarkly.client.EventOutputFormatter.writeOutputEvents(EventOutputFormatter.java:31)
at com.launchdarkly.client.DefaultEventProcessor$SendEventsTask.run(DefaultEventProcessor.java:644)
I am using version 4.12.1 of the library.
Thanks, David.