Class NumberRange<N extends Number>

java.lang.Object
org.apache.commons.lang3.Range<N>
org.apache.commons.lang3.NumberRange<N>
Type Parameters:
N - The Number class.
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DoubleRange, IntegerRange, LongRange

public class NumberRange<N extends Number> extends Range<N>
Specializes Range for Numbers.

We only offer specializations for Integer, Long, and Double (like Java Streams).

Since:
3.13.0
See Also:
  • Constructor Details

    • NumberRange

      public NumberRange(N number1, N number2, Comparator<N> comp)
      Creates an instance.
      Parameters:
      number1 - the first element, not null
      number2 - the second element, not null
      comp - the comparator to be used, null for natural ordering
      Throws:
      NullPointerException - when element1 is null.
      NullPointerException - when element2 is null.