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)
| 204 | * @since 14.0 |
| 205 | */ |
| 206 | public static <C extends Comparable<?>> Range<C> range( |
| 207 | C lower, BoundType lowerType, C upper, BoundType upperType) { |
| 208 | checkNotNull(lowerType); |
| 209 | checkNotNull(upperType); |
| 210 | |
| 211 | Cut<C> lowerBound = |
| 212 | (lowerType == BoundType.OPEN) ? Cut.aboveValue(lower) : Cut.belowValue(lower); |
| 213 | Cut<C> upperBound = |
| 214 | (upperType == BoundType.OPEN) ? Cut.belowValue(upper) : Cut.aboveValue(upper); |
| 215 | return create(lowerBound, upperBound); |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * Returns a range that contains all values strictly less than {@code |
no test coverage detected