Interface DataObject

All Known Implementing Classes:
AbstractDataObject, Command, InsertElement, ListUpdate, RemoveElement, SetProperty

public interface DataObject
Common interface for all msgbuf generated data objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Reads a JSON object containing keys for all fields of this object.
    void
    Writes a JSON object containing keys for all fields of this object.
    void
    Writes this instance to the given output.
  • Method Details

    • writeTo

      void writeTo(JsonWriter out) throws IOException
      Writes this instance to the given output.
      Parameters:
      out - The JsonWriter to write this instance to.
      Throws:
      IOException - if writing fails.
    • writeContent

      void writeContent(JsonWriter out) throws IOException
      Writes a JSON object containing keys for all fields of this object.

      In contrast to writeTo(JsonWriter), the resulting object contains no type information. Therefore, this method must only be called directly, if the reader knows the type of the object to read from the context. For reading the data, a per-type generated read[type-name]() method must be called.

      Parameters:
      out - The writer to write to.
      Throws:
      IOException
    • readContent

      void readContent(JsonReader in) throws IOException
      Reads a JSON object containing keys for all fields of this object.

      This method does not consider type information contained in the stream.

      Parameters:
      in - The writer to write to.
      Throws:
      IOException