Package com.kazforge.jsonapi.mapping
Record Class MappedDocument
java.lang.Object
java.lang.Record
com.kazforge.jsonapi.mapping.MappedDocument
public record MappedDocument(com.kazforge.jsonapi.core.model.JsonApiDocument document, Set<com.kazforge.jsonapi.core.model.ResourceIdentity> sparseFieldsetLinkageExemptions)
extends Record
Domain-mapping result that carries the produced document plus the identities of included
resources whose inbound linkage was removed by an applied sparse fieldset during that mapping
call.
Those sparse-fieldset linkage exemptions are mapping provenance, not authorization or caller
policy. Pass the whole MappedDocument, rather than only document(), to a
JSON:API document writer; the writer composes its bound ValidationContext with the
provenance before validating and emitting. An empty set means the mapped document carries no
linkage exception and validates like any ordinary document.
-
Constructor Summary
ConstructorsConstructorDescriptionMappedDocument(com.kazforge.jsonapi.core.model.JsonApiDocument document, Set<com.kazforge.jsonapi.core.model.ResourceIdentity> sparseFieldsetLinkageExemptions) Creates an instance of aMappedDocumentrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.kazforge.jsonapi.core.model.JsonApiDocumentdocument()Returns the value of thedocumentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Set<com.kazforge.jsonapi.core.model.ResourceIdentity> Returns the value of thesparseFieldsetLinkageExemptionsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MappedDocument
public MappedDocument(com.kazforge.jsonapi.core.model.JsonApiDocument document, Set<com.kazforge.jsonapi.core.model.ResourceIdentity> sparseFieldsetLinkageExemptions) Creates an instance of aMappedDocumentrecord class.- Parameters:
document- the value for thedocumentrecord componentsparseFieldsetLinkageExemptions- the value for thesparseFieldsetLinkageExemptionsrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
document
public com.kazforge.jsonapi.core.model.JsonApiDocument document()Returns the value of thedocumentrecord component.- Returns:
- the value of the
documentrecord component
-
sparseFieldsetLinkageExemptions
Returns the value of thesparseFieldsetLinkageExemptionsrecord component.- Returns:
- the value of the
sparseFieldsetLinkageExemptionsrecord component
-