Class ValidPortValidator
- java.lang.Object
-
- org.apache.logging.log4j.core.config.plugins.validation.validators.ValidPortValidator
-
- All Implemented Interfaces:
ConstraintValidator<ValidPort>
public class ValidPortValidator extends java.lang.Object implements ConstraintValidator<ValidPort>
Validator that checks an object to verify it is a valid port number (an integer between 0 and 65535).- Since:
- 2.8
-
-
Field Summary
Fields Modifier and Type Field Description private ValidPortannotationprivate static LoggerLOGGER
-
Constructor Summary
Constructors Constructor Description ValidPortValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize(ValidPort annotation)Called before this validator is used with the constraint annotation value.booleanisValid(java.lang.String name, java.lang.Object value)Indicates if the given value is valid.
-
-
-
Method Detail
-
initialize
public void initialize(ValidPort annotation)
Description copied from interface:ConstraintValidatorCalled before this validator is used with the constraint annotation value.- Specified by:
initializein interfaceConstraintValidator<ValidPort>- Parameters:
annotation- the annotation value this validator will be validating.
-
isValid
public boolean isValid(java.lang.String name, java.lang.Object value)Description copied from interface:ConstraintValidatorIndicates if the given value is valid.- Specified by:
isValidin interfaceConstraintValidator<ValidPort>- Parameters:
name- the name to use for error reportingvalue- the value to validate.- Returns:
trueif the given value is valid.
-
-