Range.javaA generic closed interval [minValue, maxValue] with a doesMatch(value) containment check. 102 lines. Works with any type that implements Comparable — integers, dates, strings, BigDecimals, etc. The constructor auto-sorts the two boundary values — new Range(5, 1) produces minValue=1, maxValue=5 regardless of argument order. The doesMatch(value) method checks minValue <= value <= maxValue using compareTo().
This is part of the range matching framework: Range<T> (single interval) → Ranges<T> (union of intervals) → IntRanges (#735, integer specialization). Used for timesheet week filtering, date range matching, and numeric value validation.
Setters setMinValue() and setMaxValue() return this for chaining: new Range<>(1, 10).setMinValue(2).setMaxValue(9). Note: changing min/max after construction does not re-sort — if you set min=100 and max=1, doesMatch() will always return false (no value can be simultaneously >= 100 and <= 1). The auto-sort only happens in the constructor.