Interface ConfigValidator<T,A extends Annotation>
public interface ConfigValidator<T,A extends Annotation>
A config validator is used to read a custom validation annotation from a config field
and validate the value so it for example matches an int range.
Validators are applied when a config is read from a file. They are not applied if a
server sends a config and they'll not validate the default value.
-
Method Details
-
type
Gets the class of the type that this validator can validate. -
annotation
Gets the class of the annotation type used by this validator. -
validate
Validates a value. For a correct value this should return an empty Optional. For an incorrect value this should return an Optional containing the corrected value. -
comment
Returns a list of comment lines that will be added to the values specified in@Config
.
-