protected void validateRange()

in sources/src/main/java/com/google/solutions/jitaccess/catalog/policy/AbstractProperty.java [195:207]


  protected void validateRange(@Nullable Duration value) {
    super.validateRange(value);

    if (value != null && this.minInclusive != null && value.compareTo(this.minInclusive) < 0) {
      throw new IllegalArgumentException(
        String.format("The value for '%s' is too small", this.displayName()));
    }

    if (value != null && this.maxInclusive != null && value.compareTo(this.maxInclusive) > 0) {
      throw new IllegalArgumentException(
        String.format("The value for '%s' is too large", this.displayName()));
    }
  }