singleton<C extends Comparable> static method

Range<C> singleton<C extends Comparable>(
  1. C value
)

Returns a range that {@linkplain Range#contains(Comparable) contains} only the given value. The returned range is {@linkplain BoundType#CLOSED closed} on both ends.

@since 14.0

Implementation

static Range<C> singleton<C extends Comparable>(C value) {
  return closed(value, value);
}