Class PositiveDurationValidator

java.lang.Object
com.github.joschi.jadconfig.validators.PositiveDurationValidator
All Implemented Interfaces:
Validator<Duration>

public class PositiveDurationValidator extends Object implements Validator<Duration>
Validator class which checks if the named parameter is a positive Duration.
Author:
jschalanda
  • Constructor Details

    • PositiveDurationValidator

      public PositiveDurationValidator()
  • Method Details

    • validate

      public void validate(String name, Duration value) throws ValidationException
      Validates if the value value the of provided configuration parameter name is a positive Duration
      Specified by:
      validate in interface Validator<Duration>
      Parameters:
      name - The name of the configuration parameter
      value - The value of the configuration validator
      Throws:
      ValidationException - If the value value configuration parameter name can't be parsed as an Duration or is negative.