Package com.tnsai.quality.security
Record Class DestructiveCommandDetector.DestructivePattern
java.lang.Object
java.lang.Record
com.tnsai.quality.security.DestructiveCommandDetector.DestructivePattern
- Enclosing class:
DestructiveCommandDetector
public static record DestructiveCommandDetector.DestructivePattern(String name, DestructiveCommandDetector.Severity severity, Pattern regex)
extends Record
A single named pattern with its severity classification.
-
Constructor Summary
ConstructorsConstructorDescriptionDestructivePattern(String name, DestructiveCommandDetector.Severity severity, Pattern regex) Creates an instance of aDestructivePatternrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.of(String name, DestructiveCommandDetector.Severity severity, String regex) Convenience factory that compilesregexwith case-insensitive flag.regex()Returns the value of theregexrecord component.severity()Returns the value of theseverityrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DestructivePattern
Creates an instance of aDestructivePatternrecord class.- Parameters:
name- the value for thenamerecord componentseverity- the value for theseverityrecord componentregex- the value for theregexrecord component
-
-
Method Details
-
of
public static DestructiveCommandDetector.DestructivePattern of(String name, DestructiveCommandDetector.Severity severity, String regex) Convenience factory that compilesregexwith case-insensitive flag. -
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
severity
Returns the value of theseverityrecord component.- Returns:
- the value of the
severityrecord component
-
regex
Returns the value of theregexrecord component.- Returns:
- the value of the
regexrecord component
-