Record Class IntRangeFilterElement
java.lang.Object
java.lang.Record
com.puppycrawl.tools.checkstyle.filters.IntRangeFilterElement
- Record Components:
lowerBound- the lower bound of the rangeupperBound- the upper bound of the range
- All Implemented Interfaces:
IntFilterElement
record IntRangeFilterElement(Integer lowerBound, Integer upperBound)
extends Record
implements IntFilterElement
This filter element is immutable and accepts an Integer in a range.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IntegerThe field for thelowerBoundrecord component.private final IntegerThe field for theupperBoundrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionIntRangeFilterElement(Integer lowerBound, Integer upperBound) Creates an instance of aIntRangeFilterElementrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(int intValue) Determines whether or not a filtered Integer is accepted.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelowerBoundrecord component.toString()Returns a string representation of this record class.Returns the value of theupperBoundrecord component.
-
Field Details
-
lowerBound
The field for thelowerBoundrecord component. -
upperBound
The field for theupperBoundrecord component.
-
-
Constructor Details
-
IntRangeFilterElement
IntRangeFilterElement(Integer lowerBound, Integer upperBound) Creates an instance of aIntRangeFilterElementrecord class.- Parameters:
lowerBound- the value for thelowerBoundrecord componentupperBound- the value for theupperBoundrecord component
-
-
Method Details
-
accept
Description copied from interface:IntFilterElementDetermines whether or not a filtered Integer is accepted.- Specified by:
acceptin interfaceIntFilterElement- Parameters:
intValue- the Integer to filter.- Returns:
- true if the intValue is accepted.
-
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). -
lowerBound
Returns the value of thelowerBoundrecord component.- Returns:
- the value of the
lowerBoundrecord component
-
upperBound
Returns the value of theupperBoundrecord component.- Returns:
- the value of the
upperBoundrecord component
-