Class PersonHasNameValidator
java.lang.Object
info.ejava.examples.db.validation.contacts.dto.PersonHasNameValidator
- All Implemented Interfaces:
jakarta.validation.ConstraintValidator<PersonHasName,
PersonPocDTO>
public class PersonHasNameValidator
extends Object
implements jakarta.validation.ConstraintValidator<PersonHasName,PersonPocDTO>
This validator will return true if either the first or lastName of the person DTO
is non-null.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
initialize
(PersonHasName constraintAnnotation) boolean
isValid
(PersonPocDTO person, jakarta.validation.ConstraintValidatorContext context)
-
Constructor Details
-
PersonHasNameValidator
public PersonHasNameValidator()
-
-
Method Details
-
initialize
- Specified by:
initialize
in interfacejakarta.validation.ConstraintValidator<PersonHasName,
PersonPocDTO>
-
isValid
- Specified by:
isValid
in interfacejakarta.validation.ConstraintValidator<PersonHasName,
PersonPocDTO>
-