[5.4.0] - 2021-04-22
Added:
- Added the
alias
method toLDClient
. This can be used to associate two user objects for analytics purposes with an alias event. - In
com.launchdarkly.sdk.json.LDGson
, added convenience methodsvalueToJsonElement
andvalueMapToJsonElementMap
for applications that use Gson types. - In
com.launchdarkly.sdk.LDValue
, added convenience methodarrayOf()
.
Changed:
- In
com.launchdarkly.sdk.json
, the implementations ofLDGson.typeAdapters
andLDJackson.module
have been changed for better efficiency in deserialization. Instead of creating an intermediate string representation and re-parsing that, they now have a more direct way for the internal deserialization logic to interact with the streaming parser in the application's Gson or Jackson instance.
Fixed:
Gson.toJsonTree
now works with LaunchDarkly types, as long as you have configured it as described incom.launchdarkly.sdk.json.LDGson
. Previously, Gson was able to convert these types to and from JSON string data, buttoJsonTree
did not work due to a known issue with theJsonWriter.jsonValue
method; the SDK code no longer uses that method.LDValue.parse()
now returnsLDValue.ofNull()
instead of an actual null reference if the JSON string isnull
.- Similarly, when deserializing an
EvaluationDetail<LDValue>
from JSON, if thevalue
property isnull
, it will now translate this intoLDValue.ofNull()
rather than an actual null reference.