Package com.tnsai.quality.redaction
Record Class RedactionFinding
java.lang.Object
java.lang.Record
com.tnsai.quality.redaction.RedactionFinding
- Record Components:
patternName- short stable name of the pattern that fired —"email","credit_card","openai_api_key", etc.startOffset- start index in the pre-redaction input (inclusive)endOffset- end index in the pre-redaction input (exclusive)placeholder- the replacement string the redactor wrote inseverity- sensitivity tier of this match
public record RedactionFinding(String patternName, int startOffset, int endOffset, String placeholder, Severity severity)
extends Record
One redacted match inside a string (issue #80).
Surfaces enough metadata for an audit trail without exposing the redacted content itself: which pattern, where in the input, what placeholder replaced it, and how serious the match was. Operators get visibility ("we redacted 3 credit-card matches today") without the audit log itself becoming a leak vector.
- Since:
- 0.5.0 (issue #80)
-
Constructor Summary
ConstructorsConstructorDescriptionRedactionFinding(String patternName, int startOffset, int endOffset, String placeholder, Severity severity) Creates an instance of aRedactionFindingrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theendOffsetrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intlength()Length of the matched span in the original input.Returns the value of thepatternNamerecord component.Returns the value of theplaceholderrecord component.severity()Returns the value of theseverityrecord component.intReturns the value of thestartOffsetrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RedactionFinding
public RedactionFinding(String patternName, int startOffset, int endOffset, String placeholder, Severity severity) Creates an instance of aRedactionFindingrecord class.- Parameters:
patternName- the value for thepatternNamerecord componentstartOffset- the value for thestartOffsetrecord componentendOffset- the value for theendOffsetrecord componentplaceholder- the value for theplaceholderrecord componentseverity- the value for theseverityrecord component
-
-
Method Details
-
length
public int length()Length of the matched span in the original input. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
patternName
Returns the value of thepatternNamerecord component.- Returns:
- the value of the
patternNamerecord component
-
startOffset
public int startOffset()Returns the value of thestartOffsetrecord component.- Returns:
- the value of the
startOffsetrecord component
-
endOffset
public int endOffset()Returns the value of theendOffsetrecord component.- Returns:
- the value of the
endOffsetrecord component
-
placeholder
Returns the value of theplaceholderrecord component.- Returns:
- the value of the
placeholderrecord component
-
severity
Returns the value of theseverityrecord component.- Returns:
- the value of the
severityrecord component
-