java.lang.Object
com.dlsc.formsfx.model.validators.CustomValidator<T>
- All Implemented Interfaces:
Validator<T>
- Direct Known Subclasses:
DoubleRangeValidator,IntegerRangeValidator,SelectionLengthValidator,StringLengthValidator
public class CustomValidator<T> extends Object
A custom validator implementation of the root validator. This validator
takes a generic object as an input parameter and allows users to perform
any kind of validation.
- Author:
- Sacha Schmid, Rinesch Murugathas
-
Constructor Summary
Constructors Modifier Constructor Description protectedCustomValidator(Predicate<T> callback, String errorMessage) -
Method Summary
Modifier and Type Method Description protected ValidationResultcreateResult(boolean result)Creates aValidationResultbased on the validation result.static <E> CustomValidator<E>forPredicate(Predicate<E> callback, String errorMessage)ValidationResultvalidate(T input)
-
Constructor Details
-
Method Details
-
forPredicate
-
validate
-
createResult
Creates aValidationResultbased on the validation result.- Parameters:
result- The result of the validation.- Returns:
- Returns a new ValidationResult containing result and message.
-