Package com.example.common.validate
Class IpValidator
java.lang.Object
com.example.common.validate.BaseValidator
com.example.common.validate.IpValidator
- All Implemented Interfaces:
ValidatorInterface
The IpValidator class extends the BaseValidator class and implements the ValidatorInterface for validating IP addresses.
-
Field Summary
Fields inherited from class com.example.common.validate.BaseValidator
value
-
Constructor Summary
ConstructorsConstructorDescriptionIpValidator
(String value) Constructs an IpValidator object with the specified value. -
Method Summary
Modifier and TypeMethodDescriptionboolean
validate()
Validates the IP address value using a regular expression pattern.
-
Constructor Details
-
IpValidator
Constructs an IpValidator object with the specified value.- Parameters:
value
- the IP address value to validate
-
-
Method Details
-
validate
public boolean validate()Validates the IP address value using a regular expression pattern.- Specified by:
validate
in interfaceValidatorInterface
- Returns:
- true if the IP address is valid, false otherwise
-