public class DurationCastedToIntegerValidator extends Object implements com.github.joschi.jadconfig.Validator<com.github.joschi.jadconfig.util.Duration>
Constructor and Description |
---|
DurationCastedToIntegerValidator() |
Modifier and Type | Method and Description |
---|---|
void |
validate(String name,
com.github.joschi.jadconfig.util.Duration value)
Validates if the value value of the provided configuration parameter name is a positive
Duration , that is not higher than 24 days. |
public void validate(String name, com.github.joschi.jadconfig.util.Duration value) throws com.github.joschi.jadconfig.ValidationException
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.validate
in interface com.github.joschi.jadconfig.Validator<com.github.joschi.jadconfig.util.Duration>
name
- The name of the configuration parametervalue
- The value of the configuration validatorcom.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.Copyright © 2012–2021 Graylog, Inc.. All rights reserved.