Package com.example.common.validate
Class ListValidation
java.lang.Object
com.example.common.validate.ListValidation
- All Implemented Interfaces:
ValidatorInterface
The ListValidation class implements the ValidatorInterface to validate a list of validators.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(ValidatorInterface validator) Add new type of validator to common listvoid
remove
(int index) Removes a validator from the list at the specified index.int
size()
Returns the number of validators in the list.boolean
validate()
Validates each validator in the list.
-
Constructor Details
-
ListValidation
public ListValidation()
-
-
Method Details
-
validate
public boolean validate()Validates each validator in the list.- Specified by:
validate
in interfaceValidatorInterface
- Returns:
- true if all validators pass, false if any validator fails
-
add
Add new type of validator to common list- Parameters:
validator
- the validator to add
-
remove
public void remove(int index) Removes a validator from the list at the specified index.- Parameters:
index
- the index of the validator to remove
-
size
public int size()Returns the number of validators in the list.- Returns:
- the size of the validator list
-