Interface IModelInstanceWriteHandler<ITEM>

Type Parameters:
ITEM - the Java type of items being written
All Known Implementing Classes:
AbstractModelInstanceWriteHandler

public interface IModelInstanceWriteHandler<ITEM>
Handler interface for writing model instance collections during serialization.

This interface provides methods for iterating over collection items and writing them to an output stream.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Write the next item in the collection of items represented by the instance.
    void
    Write items from a list collection.
    void
    Write items from a map collection.
    default void
    Write a singleton item.
  • Method Details

    • writeSingleton

      default void writeSingleton(@NonNull ITEM item) throws IOException
      Write a singleton item.
      Parameters:
      item - the item to write
      Throws:
      IOException - if an error occurred while writing the output
    • writeList

      void writeList(@NonNull List<ITEM> items) throws IOException
      Write items from a list collection.
      Parameters:
      items - the list of items to write
      Throws:
      IOException - if an error occurred while writing the output
    • writeMap

      void writeMap(@NonNull Map<String,ITEM> items) throws IOException
      Write items from a map collection.
      Parameters:
      items - the map of items to write, keyed by JSON key flag value
      Throws:
      IOException - if an error occurred while writing the output
    • writeItem

      void writeItem(@NonNull ITEM item) throws IOException
      Write the next item in the collection of items represented by the instance.
      Parameters:
      item - the item Java object to write
      Throws:
      IOException - if an error occurred while parsing the input