Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
This repository was archived by the owner on May 30, 2024. It is now read-only.

A way to serialize and deserialize LDUser #199

Closed
@davebarda

Description

@davebarda

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions