Package com.tnsai.quality.redaction
Record Class RedactionResult
java.lang.Object
java.lang.Record
com.tnsai.quality.redaction.RedactionResult
Output of a
Redactor.scrubString(java.lang.String, com.tnsai.quality.redaction.RedactionContext) call (issue #80): the
redacted text plus the RedactionFindings the redactor
matched.
Returning findings as part of the result (rather than via a thread-local "lastFindings" lookup) keeps redactors stateless and thread-safe — the same redactor instance can be shared across the whole framework.
- Since:
- 0.5.0 (issue #80)
-
Constructor Summary
ConstructorsConstructorDescriptionRedactionResult(String text, List<RedactionFinding> findings) Creates an instance of aRedactionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.findings()Returns the value of thefindingsrecord component.booleantruewhen the redactor matched at least one pattern.final inthashCode()Returns a hash code value for this object.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.static RedactionResultConvenience: result for a clean input that produced no findings.
-
Constructor Details
-
RedactionResult
Creates an instance of aRedactionResultrecord class.- Parameters:
text- the value for thetextrecord componentfindings- the value for thefindingsrecord component
-
-
Method Details
-
hadFindings
public boolean hadFindings()truewhen the redactor matched at least one pattern. -
unchanged
Convenience: result for a clean input that produced no findings. -
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). -
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
findings
Returns the value of thefindingsrecord component.- Returns:
- the value of the
findingsrecord component
-