exclusiveBetween static method

void exclusiveBetween(
  1. Comparable start,
  2. Comparable end,
  3. Comparable value, [
  4. String message = DEFAULT_EXCLUSIVE_BETWEEN_EX_MESSAGE,
])

Validate that the specified argument object fall between the two exclusive values specified; otherwise, throws an exception.

Validate.inclusiveBetween(0, 2, 1);

start the exclusive start value, not null end the exclusive end value, not null value the object to validate, not null Throws ArgumentError if the value falls out of the boundaries

Implementation

static void exclusiveBetween(
    Comparable start, Comparable end, Comparable value,
    [String message = DEFAULT_EXCLUSIVE_BETWEEN_EX_MESSAGE]) {
  if (value.compareTo(start) <= 0 || value.compareTo(end) >= 0) {
    throw new ArgumentError(message);
  }
}