Class DurationCastedToIntegerValidator

java.lang.Object
org.graylog2.configuration.DurationCastedToIntegerValidator
All Implemented Interfaces:
com.github.joschi.jadconfig.Validator<com.github.joschi.jadconfig.util.Duration>

public class DurationCastedToIntegerValidator extends Object implements com.github.joschi.jadconfig.Validator<com.github.joschi.jadconfig.util.Duration>
  • Constructor Details

    • DurationCastedToIntegerValidator

      public DurationCastedToIntegerValidator()
  • Method Details

    • validate

      public void validate(String name, com.github.joschi.jadconfig.util.Duration value) throws com.github.joschi.jadconfig.ValidationException
      Validates if the value value of the provided configuration parameter name is a positive Duration, that is not higher than 24 days. This constraint is related to the duration (in milliseconds) being casted to integer at some point. Integer.MAX_VALUE / (24 * 60 * 60 * 1000) roughly equals to 24 days.
      Specified by:
      validate in interface com.github.joschi.jadconfig.Validator<com.github.joschi.jadconfig.util.Duration>
      Parameters:
      name - The name of the configuration parameter
      value - The value of the configuration validator
      Throws:
      com.github.joschi.jadconfig.ValidationException - If the value value configuration parameter name can't be parsed as a Duration, is negative or higher than 24 days.