Interface JsonApiRelationships


public interface JsonApiRelationships
Level-1 relationship-linkage document operations in both directions.

The facet is linkage-only: it expresses to-one, explicit-null, and to-many identifier primary data without domain DTO registration and without hydrating related-resource documents. A to-one read never accepts a collection and a to-many read never accepts one identifier or null; cross-shape states fail instead of coercing. Related-resource handling and top-level document members on linkage documents stay on the documents facet or an advanced path.

  • Method Summary

    Modifier and Type
    Method
    Description
    List<com.kazforge.jsonapi.core.model.ResourceIdentifier>
    Stream variant of readToMany(String).
    List<com.kazforge.jsonapi.core.model.ResourceIdentifier>
    Reads a to-many linkage document, including the empty collection.
    @Nullable com.kazforge.jsonapi.core.model.ResourceIdentifier
    Stream variant of readToOne(String).
    @Nullable com.kazforge.jsonapi.core.model.ResourceIdentifier
    Reads a to-one linkage document.
    writeToMany(List<? extends com.kazforge.jsonapi.core.model.ResourceIdentifier> identifiers)
    Writes a to-many linkage document and returns its JSON.
    void
    writeToMany(List<? extends com.kazforge.jsonapi.core.model.ResourceIdentifier> identifiers, OutputStream out)
    Writes a to-many linkage document to the given stream.
    writeToOne(@Nullable com.kazforge.jsonapi.core.model.ResourceIdentifier identifier)
    Writes a to-one linkage document and returns its JSON.
    void
    writeToOne(@Nullable com.kazforge.jsonapi.core.model.ResourceIdentifier identifier, OutputStream out)
    Writes a to-one linkage document to the given stream.
  • Method Details

    • readToOne

      @Nullable com.kazforge.jsonapi.core.model.ResourceIdentifier readToOne(String json)
      Reads a to-one linkage document. Returns the identifier, or null for explicit data: null linkage.
    • readToOne

      @Nullable com.kazforge.jsonapi.core.model.ResourceIdentifier readToOne(InputStream json)
      Stream variant of readToOne(String). The stream is not closed. Returns the identifier, or null for explicit data: null linkage.
    • readToMany

      List<com.kazforge.jsonapi.core.model.ResourceIdentifier> readToMany(String json)
      Reads a to-many linkage document, including the empty collection.
    • readToMany

      List<com.kazforge.jsonapi.core.model.ResourceIdentifier> readToMany(InputStream json)
      Stream variant of readToMany(String). The stream is not closed.
    • writeToOne

      String writeToOne(@Nullable com.kazforge.jsonapi.core.model.ResourceIdentifier identifier)
      Writes a to-one linkage document and returns its JSON. A null identifier emits explicit data: null linkage.
    • writeToOne

      void writeToOne(@Nullable com.kazforge.jsonapi.core.model.ResourceIdentifier identifier, OutputStream out)
      Writes a to-one linkage document to the given stream. The stream is not closed. A null identifier emits explicit data: null linkage.
    • writeToMany

      String writeToMany(List<? extends com.kazforge.jsonapi.core.model.ResourceIdentifier> identifiers)
      Writes a to-many linkage document and returns its JSON.

      The wildcard bound lets callers pass lists held through generic APIs; it is redundant only because ResourceIdentifier is final.

    • writeToMany

      void writeToMany(List<? extends com.kazforge.jsonapi.core.model.ResourceIdentifier> identifiers, OutputStream out)
      Writes a to-many linkage document to the given stream. The stream is not closed.

      The wildcard bound lets callers pass lists held through generic APIs; it is redundant only because ResourceIdentifier is final.