Package io.kroxylicious.proxy.config
Record Class Range
java.lang.Object
java.lang.Record
io.kroxylicious.proxy.config.Range
Represents the set of integers between two integer endpoints. So the Range
with startInclusive 1 and endExclusive 3 contains the integers 1 and 2.
A Range must be non-empty, endExclusive must be greater than startInclusive
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theendExclusiverecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisDistinctFrom(Range range) Return true if this range does not overlap with other range.intReturns the value of thestartInclusiverecord component.toString()Returns a string representation of this record class.values()Provides a Stream of values contained in the range
-
Constructor Details
-
Range
public Range(int startInclusive, int endExclusive) Constructs a Range- Parameters:
startInclusive- the (inclusive) initial valueendExclusive- the exclusive 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. -
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. All components in this record class are compared with '=='. -
startInclusive
public int startInclusive()Returns the value of thestartInclusiverecord component.- Returns:
- the value of the
startInclusiverecord component
-
endExclusive
public int endExclusive()Returns the value of theendExclusiverecord component.- Returns:
- the value of the
endExclusiverecord component
-