All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.isi.nlp.validators.IsInRange Maven / Gradle / Ivy

The newest version!
package edu.isi.nlp.validators;

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.common.collect.Range;

public class IsInRange> implements Validator {

  public IsInRange(Range range) {
    this.range = checkNotNull(range);
  }

  @Override
  public void validate(T arg) throws ValidationException {
    if (!range.contains(arg)) {
      throw new ValidationException(String.format("%s not in range %s", arg, range));
    }
  }

  private final Range range;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy