Package io.kroxylicious.proxy.config
Record Class NamedRange
java.lang.Object
java.lang.Record
io.kroxylicious.proxy.config.NamedRange
Represents the inclusive set of integers between two integer endpoints. So the range
with start 1 and end 3 contains the integers 1, 2, and 3.
A Range must be non-empty, end must be greater than start
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintend()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisDistinctFrom(NamedRange range) Return true if this range does not overlap with other range.name()Returns the value of thenamerecord component.intstart()Returns the value of thestartrecord component.toString()Returns a string representation of this record class.values()Provides a Stream of values contained in the range
-
Constructor Details
-
NamedRange
Constructs a Range- Parameters:
name- range namestart- the inclusive lower valueend- the inclusive upper bound- Throws:
IllegalArgumentException- if end is before start
-
-
Method Details
-
values
Provides a Stream of values contained in the range- Returns:
- stream of values
-
isDistinctFrom
Return true if this range does not overlap with other range. If either range ends before the other starts then they must not overlap.- Parameters:
range- range to compare- Returns:
- true if this range does not overlap with other range
-
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. -
toIntervalNotationString
-
hashCode
public final int 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 '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
start
public int start()Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
public int end()Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-