Package com.puppycrawl.tools.checkstyle
Record Class SarifLogger.RuleKey
java.lang.Object
java.lang.Record
com.puppycrawl.tools.checkstyle.SarifLogger.RuleKey
- Record Components:
sourceName- The fully qualified source class name.moduleId- The module ID from configuration (can be null).
- Enclosing class:
- SarifLogger
Composite key for uniquely identifying a rule by source name and module ID.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for themoduleIdrecord component.private final StringThe field for thesourceNamerecord component. -
Constructor Summary
Constructors -
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.moduleId()Returns the value of themoduleIdrecord component.Returns the value of thesourceNamerecord component.private StringtoRuleId()Converts this key to a SARIF rule ID string.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
sourceName
The field for thesourceNamerecord component. -
moduleId
The field for themoduleIdrecord component.
-
-
Constructor Details
-
RuleKey
Creates an instance of aRuleKeyrecord class.- Parameters:
sourceName- the value for thesourceNamerecord componentmoduleId- the value for themoduleIdrecord component
-
-
Method Details
-
toRuleId
Converts this key to a SARIF rule ID string.- Returns:
- rule ID in format: sourceName[#moduleId]
-
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
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). -
sourceName
Returns the value of thesourceNamerecord component.- Returns:
- the value of the
sourceNamerecord component
-
moduleId
Returns the value of themoduleIdrecord component.- Returns:
- the value of the
moduleIdrecord component
-