Interface DocumentSerdes

All Known Subinterfaces:
DocumentSerdes.Delegating

@Internal public interface DocumentSerdes
Serdes kept for the duration of one document by the encoder or decoder context of the document. A serde that is kept between documents stores the serdes it specialized for a document here, under itself, instead of holding them: such a serde can keep its context, so holding it would keep the document.

A context that keeps document serdes must be confined to a single document and thread, and closed at the end of the document, as the contexts the mappers open for each call are. The values are not synchronized.

Since:
3.3.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Document serdes kept by another context, such as the context a derived context delegates to.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @Nullable Object
    get(Object context, Object owner)
     
    @Nullable Object
     
    static boolean
    keeps(Object context)
     
    static void
    put(Object context, Object owner, Object value)
    Stores a value for the rest of the document of the context, when the context keeps document serdes.
    void
    Stores a value for the rest of the document.
  • Method Details

    • getDocumentSerde

      @Nullable Object getDocumentSerde(Object owner)
      Parameters:
      owner - The serde that stored the value
      Returns:
      The value stored by the owner for this document, or null
    • putDocumentSerde

      void putDocumentSerde(Object owner, Object value)
      Stores a value for the rest of the document.
      Parameters:
      owner - The serde that stores the value
      value - The value
    • get

      static @Nullable Object get(Object context, Object owner)
      Parameters:
      context - The encoder or decoder context
      owner - The serde that stored the value
      Returns:
      The value stored by the owner for the document of the context, or null when there is none or the context keeps no document serdes
    • put

      static void put(Object context, Object owner, Object value)
      Stores a value for the rest of the document of the context, when the context keeps document serdes.
      Parameters:
      context - The encoder or decoder context
      owner - The serde that stores the value
      value - The value
    • keeps

      static boolean keeps(Object context)
      Parameters:
      context - The encoder or decoder context
      Returns:
      Whether the context, or the context it delegates to, keeps document serdes