Package com.identity4j.util.validator
Class IpAddressValidator
- java.lang.Object
-
- com.identity4j.util.validator.AbstractSingleValueValidator
-
- com.identity4j.util.validator.IpAddressValidator
-
- All Implemented Interfaces:
Validator
public class IpAddressValidator extends AbstractSingleValueValidator
A validator implementation that checks the supplied value is a valid ip address or host name. This validator also verifies the supplied port, ifINCLUDES_PORTis set to true. If theINCLUDES_PORTis not specified, the validator uses the default value.
-
-
Field Summary
Fields Modifier and Type Field Description static StringINCLUDES_PORTParameter which when supplied, specifies the if the ip address supplied can include a port.-
Fields inherited from class com.identity4j.util.validator.AbstractSingleValueValidator
REQUIRED, TRIM
-
-
Constructor Summary
Constructors Constructor Description IpAddressValidator(MultiMap parameters)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanisHostName(String ipAddressOrHostName)StringtoString()-
Methods inherited from class com.identity4j.util.validator.AbstractSingleValueValidator
isValueRequired, validate
-
-
-
-
Field Detail
-
INCLUDES_PORT
public static final String INCLUDES_PORT
Parameter which when supplied, specifies the if the ip address supplied can include a port. If this value is not supplied, the validator defaults to a allowing the port to be included.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IpAddressValidator
public IpAddressValidator(MultiMap parameters)
Constructor.- Parameters:
parameters- parameters
-
-
Method Detail
-
isHostName
public static final boolean isHostName(String ipAddressOrHostName)
-
toString
public final String toString()
- Overrides:
toStringin classAbstractSingleValueValidator
-
-