Interface BinaryObjectReader


public interface BinaryObjectReader
A reader interface for accessing binary object data in a structured format.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a list of all field names available in this object.
    boolean
    Checks whether field exists in the object.
    @Nullable Object
    Reads and returns the value of the specified field.
    Returns the name of the type being read.
  • Method Details

    • typeName

      String typeName()
      Returns the name of the type being read.
    • fieldNames

      List<String> fieldNames()
      Returns a list of all field names available in this object.

      The returned list contains the names of all fields that can be accessed via readField(String).

      Returns:
      A list of field names, never null.
    • hasField

      boolean hasField(String name)
      Checks whether field exists in the object.
      Returns:
      true if the object contains field with given name, returns false otherwise.
    • readField

      @Nullable @Nullable Object readField(String name)
      Reads and returns the value of the specified field.

      If the field exists but contains a null value, this method returns null. If the field does not exist, this method also returns null. Callers should use hasField(String) or fieldNames() to distinguish between these cases if necessary.

      Parameters:
      name - The name of the field to read; should not be null.
      Returns:
      The field value, or null if the field does not exist, or the field value is null.