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
-
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.(package private) static MultiFileRegexpHeaderCheck.MatchResultmatching()Creates a matching result.Returns the value of themessageArgrecord component.Returns the value of themessageKeyrecord component.(package private) static MultiFileRegexpHeaderCheck.MatchResultCreates a mismatch result.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
isMatching
private final boolean isMatchingThe field for theisMatchingrecord component. -
lineNumber
private final int lineNumberThe 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
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
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
isMatching
public boolean isMatching()Returns the value of theisMatchingrecord component.- Returns:
- the value of the
isMatchingrecord component
-
lineNumber
public int 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
-