Package org.cyclos.model.utils
Interface Range<T extends Comparable<T>>
-
- All Known Subinterfaces:
ICurrencyAmountRange,IDecimalRange,IIntegerRange
- All Known Implementing Classes:
CurrencyAmountRange,CurrencyAmountRangeDTO,DateRange,DecimalRange,DecimalRangeDTO,IntegerRange,IntegerRangeDTO
public interface Range<T extends Comparable<T>>Common interface for ranges
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description TgetMax()TgetMin()static <T extends Comparable<T>>
booleanincludes(Range<T> range, T value)Returns whether the given range includes the given value, inclusive.static booleanisEmpty(Range<?> range)Returns whether the given range is empty
-
-
-
Method Detail
-
includes
static <T extends Comparable<T>> boolean includes(Range<T> range, T value)
Returns whether the given range includes the given value, inclusive. If the range is null or both min and max are null, the result is true, as it is considered as unrestricted. If the range has only min / max, it is assumed the missing part is unrestricted. If the value is null, returns false;
-
isEmpty
static boolean isEmpty(Range<?> range)
Returns whether the given range is empty
-
getMax
T getMax()
-
getMin
T getMin()
-
-