Package com.tnsai.quality.security
Record Class SecretFilter.ScrubResult
java.lang.Object
java.lang.Record
com.tnsai.quality.security.SecretFilter.ScrubResult
- Record Components:
scrubbedText- the redacted textdetections- map of pattern name to count of matches
- Enclosing class:
SecretFilter
public static record SecretFilter.ScrubResult(String scrubbedText, Map<String,Integer> detections)
extends Record
Result of a scrub operation with metadata.
-
Constructor Summary
ConstructorsConstructorDescriptionScrubResult(String scrubbedText, Map<String, Integer> detections) Creates an instance of aScrubResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedetectionsrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanReturns true if any secrets were detected and scrubbed.final inthashCode()Returns a hash code value for this object.Returns the value of thescrubbedTextrecord component.final StringtoString()Returns a string representation of this record class.intReturns total number of redactions made.
-
Constructor Details
-
ScrubResult
Creates an instance of aScrubResultrecord class.- Parameters:
scrubbedText- the value for thescrubbedTextrecord componentdetections- the value for thedetectionsrecord component
-
-
Method Details
-
hasDetections
public boolean hasDetections()Returns true if any secrets were detected and scrubbed.- Returns:
- true if secrets found
-
totalRedactions
public int totalRedactions()Returns total number of redactions made.- Returns:
- total redaction count
-
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). -
scrubbedText
Returns the value of thescrubbedTextrecord component.- Returns:
- the value of the
scrubbedTextrecord component
-
detections
Returns the value of thedetectionsrecord component.- Returns:
- the value of the
detectionsrecord component
-