Package org.opensearch.client.json
Class ExternallyTaggedUnion
java.lang.Object
org.opensearch.client.json.ExternallyTaggedUnion
Utilities for union types whose discriminant is not directly part of the structure, either as an enclosing property name or as
an inner property. This is used for OpenSearch aggregation results and suggesters, using the
typed_keys parameter that
encodes a name+type in a single JSON property.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classExternallyTaggedUnion.Deserializer<Union extends TaggedUnion<?,?>, Member> A deserializer for externally-tagged unions.static classExternallyTaggedUnion.TypedKeysDeserializer<Union extends TaggedUnion<?,?>> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends TaggedUnion<?,?>>
JsonpDeserializer<Map<String, List<T>>> arrayDeserializer(ExternallyTaggedUnion.TypedKeysDeserializer<T> deserializer) static <T extends JsonpSerializable & TaggedUnion<? extends JsonEnum,?>>
voidserializeTypedKeys(Map<String, T> map, jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize an externally tagged union using the typed keys encoding.static <T extends JsonpSerializable & TaggedUnion<? extends JsonEnum,?>>
voidserializeTypedKeysInner(Map<String, T> map, jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize an externally tagged union using the typed keys encoding, without the enclosing start/end object.
-
Method Details
-
arrayDeserializer
public static <T extends TaggedUnion<?,?>> JsonpDeserializer<Map<String,List<T>>> arrayDeserializer(ExternallyTaggedUnion.TypedKeysDeserializer<T> deserializer) -
serializeTypedKeys
public static <T extends JsonpSerializable & TaggedUnion<? extends JsonEnum,?>> void serializeTypedKeys(Map<String, T> map, jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize an externally tagged union using the typed keys encoding. -
serializeTypedKeysInner
public static <T extends JsonpSerializable & TaggedUnion<? extends JsonEnum,?>> void serializeTypedKeysInner(Map<String, T> map, jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize an externally tagged union using the typed keys encoding, without the enclosing start/end object.
-