Class RepresentationSelection

java.lang.Object
com.kazforge.jsonapi.representation.RepresentationSelection

public final class RepresentationSelection extends Object
Backend-independent immutable per-operation selection of include paths and sparse fieldsets. The current Jackson adapters resolve its JSON:API member names through caller-configured Jackson.

An absent include request (include was not supplied) omits included. An explicitly requested empty include emits included: [] when no resources resolve, and a non-empty include-path list that resolves to no resources does the same. An absent fieldset type leaves its attributes and relationships unrestricted; a present type with an empty list selects none. Include-path segments and field names are final JSON:API external member names resolved by the configured Jackson mapper, never logical application-property identities.

This value contains representation-shaping requests only. It does not model filters, sorting, pagination, persistence projections, authorization state, or query predicates.

  • Method Details

    • none

      public static RepresentationSelection none()
      Returns the selection that requests neither inclusion nor sparse fieldsets.
    • builder

      public static RepresentationSelection.Builder builder()
      Creates a builder for one immutable selection.
    • includePaths

      public List<IncludePath> includePaths()
      Ordered include paths requested for compound-document traversal.
    • includeRequested

      public boolean includeRequested()
      Returns whether the request explicitly supplied an include parameter.
    • fieldsets

      public Map<String,List<String>> fieldsets()
      Sparse field names by JSON:API resource type, including explicitly empty fieldsets.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object