Interface ExternallyTaggedUnion


  • public interface 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 Elasticsearch aggregation results and suggesters, using the typed_keys parameter that encodes a name+type in a single JSON property.
    • Method Detail

      • serializeTypedKeys

        static <T extends JsonpSerializable & TaggedUnion<? extends JsonEnum,​?>> void serializeTypedKeys​(java.util.Map<java.lang.String,​T> map,
                                                                                                               jakarta.json.stream.JsonGenerator generator,
                                                                                                               JsonpMapper mapper)
        Serialize an externally tagged union using the typed keys encoding.
      • serializeTypedKeysInner

        static <T extends JsonpSerializable & TaggedUnion<? extends JsonEnum,​?>> void serializeTypedKeysInner​(java.util.Map<java.lang.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.