class ParsedDocument {

    private final Field version;

    private final String id;
    private final SequenceIDFields seqID;

    private final Document document;

    private final BytesReference source;

    private final Mapping dynamicMappingsUpdate;

    public ParsedDocument(Field version,
                          SequenceIDFields seqID,
                          String id,
                          Document document,
                          BytesReference source,
                          Mapping dynamicMappingsUpdate) {
        this.version = version;
        this.seqID = seqID;
        this.id = id;
        this.document = document;
        this.source = source;
        this.dynamicMappingsUpdate = dynamicMappingsUpdate;
    }

    public String id() {
        return this.id;
    }

    public Field version() {
        return version;
    }

    public void updateSeqID(long sequenceNumber, long primaryTerm) {
        this.seqID.seqNo.setLongValue(sequenceNumber);
        this.seqID.seqNoDocValue.setLongValue(sequenceNumber);
        this.seqID.primaryTerm.setLongValue(primaryTerm);
    }

    /**
     * Makes the processing document as a tombstone document rather than a regular document.
     * Tombstone documents are stored in Lucene index to represent delete operations or Noops.
     */
    ParsedDocument toTombstone() {
        this.seqID.tombstoneField.setLongValue(1);
        doc().add(this.seqID.tombstoneField);
        return this;
    }

    public Document doc() {
        return document;
    }

    public BytesReference source() {
        return this.source;
    }

    /**
     * Return dynamic updates to mappings or {@code null} if there were no
     * updates to the mappings.
     */
    public Mapping dynamicMappingsUpdate() {
        return dynamicMappingsUpdate;
    }

    @Override
    public String toString() {<FILL_FUNCTION_BODY>}
}

        return "Document id[" + id + "] doc [" + document + ']';
    
<no_super_class>