Returns a range with no lower bound up to the given endpoint, which may be either inclusive (closed) or exclusive (open). @since 14.0
(C endpoint, BoundType boundType)
| 242 | * @since 14.0 |
| 243 | */ |
| 244 | public static <C extends Comparable<?>> Range<C> upTo(C endpoint, BoundType boundType) { |
| 245 | switch (boundType) { |
| 246 | case OPEN: |
| 247 | return lessThan(endpoint); |
| 248 | case CLOSED: |
| 249 | return atMost(endpoint); |
| 250 | default: |
| 251 | throw new AssertionError(); |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | /** |
| 256 | * Returns a range that contains all values strictly greater than {@code |
no test coverage detected