coerceAtMost method

Comparable<T> coerceAtMost(
  1. T maximumValue
)

Ensures that this value is not greater than the specified maximumValue.

Implementation

Comparable<T> coerceAtMost(T maximumValue) {
  return this > maximumValue ? maximumValue : this;
}