Class SuppressWithNearbyCommentFilter.Tag
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.filters.SuppressWithNearbyCommentFilter.Tag
-
- All Implemented Interfaces:
Comparable<SuppressWithNearbyCommentFilter.Tag>
- Enclosing class:
- SuppressWithNearbyCommentFilter
public static class SuppressWithNearbyCommentFilter.Tag extends Object implements Comparable<SuppressWithNearbyCommentFilter.Tag>
A Tag holds a suppression comment and its location.
-
-
Constructor Summary
Constructors Constructor Description Tag(String text, int line, SuppressWithNearbyCommentFilter filter)
Constructs a tag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(SuppressWithNearbyCommentFilter.Tag other)
Compares the position of this tag in the file with the position of another tag.boolean
equals(Object other)
int
hashCode()
boolean
isMatch(AuditEvent event)
Determines whether the source of an audit event matches the text of this tag.String
toString()
-
-
-
Constructor Detail
-
Tag
public Tag(String text, int line, SuppressWithNearbyCommentFilter filter)
Constructs a tag.- Parameters:
text
- the text of the suppression.line
- the line number.filter
- theSuppressWithNearbyCommentFilter
with the context- Throws:
IllegalArgumentException
- if unable to parse expanded text.
-
-
Method Detail
-
compareTo
public int compareTo(SuppressWithNearbyCommentFilter.Tag other)
Compares the position of this tag in the file with the position of another tag.- Specified by:
compareTo
in interfaceComparable<SuppressWithNearbyCommentFilter.Tag>
- Parameters:
other
- the tag to compare with this one.- Returns:
- a negative number if this tag is before the other tag, 0 if they are at the same position, and a positive number if this tag is after the other tag.
-
isMatch
public boolean isMatch(AuditEvent event)
Determines whether the source of an audit event matches the text of this tag.- Parameters:
event
- theAuditEvent
to check.- Returns:
- true if the source of event matches the text of this tag.
-
-