Returns a range that contains any value from lower to upper, where each endpoint may be either inclusive (closed) or exclusive (open). @throws IllegalArgumentException if lower is greater than upper @since 14.0
(C lower, BoundType lowerType, C upper, BoundType upperType)
| 211 | |
| 212 | |
| 213 | public static <C extends Comparable<?>> Range<C> range(C lower, BoundType lowerType, C upper, BoundType upperType) { |
| 214 | checkNotNull(lowerType); |
| 215 | checkNotNull(upperType); |
| 216 | Cut<C> lowerBound = (lowerType == BoundType.OPEN) ? Cut.aboveValue(lower) : Cut.belowValue(lower); |
| 217 | Cut<C> upperBound = (upperType == BoundType.OPEN) ? Cut.belowValue(upper) : Cut.aboveValue(upper); |
| 218 | return create(lowerBound, upperBound); |
| 219 | } |
| 220 | |
| 221 | /** |
| 222 | * Returns a range that contains all values strictly less than {@code |
no test coverage detected