Class IncludePolicy

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

public final class IncludePolicy extends Object
Decides which relationships may be traversed for compound-document inclusion.

Policy governs inclusion traversal only. Linkage emission on selected resources remains unaffected.

  • Method Details

    • denyAll

      public static IncludePolicy denyAll()
      Rejects every relationship for inclusion traversal.
    • allowAll

      public static IncludePolicy allowAll()
      Permits every mapped relationship for inclusion traversal.
    • allowing

      public static IncludePolicy allowing(Set<RelationshipAllowance> allowances)
      Permits only the given owner-type + relationship allowances. The allowance set is defensively copied.
    • allows

      public boolean allows(String ownerResourceType, String relationshipName)
      Returns whether inclusion traversal may follow relationshipName on a resource whose JSON:API type is ownerResourceType.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object