Record Class MultiFileRegexpHeaderCheck.MatchResult
java.lang.Object
java.lang.Record
com.puppycrawl.tools.checkstyle.checks.header.MultiFileRegexpHeaderCheck.MatchResult
- Record Components:
isMatching- whether the header matchedlineNumber- line number of mismatch (1-based)messageKey- message key for violationmessageArg- message argument
- Enclosing class:
MultiFileRegexpHeaderCheck
private static record MultiFileRegexpHeaderCheck.MatchResult(boolean isMatching, int lineNumber, String messageKey, String messageArg)
extends Record
Represents the result of a header match check, containing information about any mismatch.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theisMatchingrecord component.private final intThe field for thelineNumberrecord component.private final StringThe field for themessageArgrecord component.private final StringThe field for themessageKeyrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMatchResult(boolean isMatching, int lineNumber, String messageKey, String messageArg) Creates an instance of aMatchResultrecord 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.booleanReturns the value of theisMatchingrecord component.intReturns the value of thelineNumberrecord component.matching()Creates a matching result.Returns the value of themessageArgrecord component.Returns the value of themessageKeyrecord component.Creates a mismatch result.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
isMatching
The field for theisMatchingrecord component. -
lineNumber
The field for thelineNumberrecord component. -
messageKey
The field for themessageKeyrecord component. -
messageArg
The field for themessageArgrecord component.
-
-
Constructor Details
-
MatchResult
Creates an instance of aMatchResultrecord class.- Parameters:
isMatching- the value for theisMatchingrecord componentlineNumber- the value for thelineNumberrecord componentmessageKey- the value for themessageKeyrecord componentmessageArg- the value for themessageArgrecord component
-
-
Method Details
-
matching
Creates a matching result.- Returns:
- a matching result
-
mismatch
public static MultiFileRegexpHeaderCheck.MatchResult mismatch(int lineNumber, String messageKey, String messageArg) Creates a mismatch result.- Parameters:
lineNumber- the line number where mismatch occurred (1-based)messageKey- the message key for the violationmessageArg- the argument for the message- Returns:
- a mismatch result
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
isMatching
Returns the value of theisMatchingrecord component.- Returns:
- the value of the
isMatchingrecord component
-
lineNumber
Returns the value of thelineNumberrecord component.- Returns:
- the value of the
lineNumberrecord component
-
messageKey
Returns the value of themessageKeyrecord component.- Returns:
- the value of the
messageKeyrecord component
-
messageArg
Returns the value of themessageArgrecord component.- Returns:
- the value of the
messageArgrecord component
-