ComparableExtensions<T extends Comparable<T> > extension
adds limit extensions on Comparable
- on
-
- T
Methods
-
limitTo(
T min, T max) → T -
Available on T, provided by the ComparableExtensions extension
returns this if it is betweenmin
andmax
(inclusive) otherwise returnsmin
ormax
whichever is closer -
withLowerLimit(
T min) → T -
Available on T, provided by the ComparableExtensions extension
returns this if it is not greater than max, otherwise max -
withUpperLimit(
T max) → T -
Available on T, provided by the ComparableExtensions extension
returns this if it is not greater thanmax
, otherwisemax