Updates after editor feedback
This commit is contained in:
parent
c03e0919e1
commit
7ecceaf5e2
|
@ -9,15 +9,11 @@ import java.time.LocalDate;
|
||||||
@SupportedValidationTarget(ValidationTarget.PARAMETERS)
|
@SupportedValidationTarget(ValidationTarget.PARAMETERS)
|
||||||
public class ConsistentDateParameterValidator implements ConstraintValidator<ConsistentDateParameters, Object[]> {
|
public class ConsistentDateParameterValidator implements ConstraintValidator<ConsistentDateParameters, Object[]> {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize(ConsistentDateParameters constraintAnnotation) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid(Object[] value, ConstraintValidatorContext context) {
|
public boolean isValid(Object[] value, ConstraintValidatorContext context) {
|
||||||
|
|
||||||
if (value[0] == null || value[1] == null) {
|
if (value[0] == null || value[1] == null) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(value[0] instanceof LocalDate) || !(value[1] instanceof LocalDate)) {
|
if (!(value[0] instanceof LocalDate) || !(value[1] instanceof LocalDate)) {
|
||||||
|
|
|
@ -8,15 +8,11 @@ import java.time.LocalDate;
|
||||||
|
|
||||||
public class ValidReservationValidator implements ConstraintValidator<ValidReservation, Reservation> {
|
public class ValidReservationValidator implements ConstraintValidator<ValidReservation, Reservation> {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize(ValidReservation constraintAnnotation) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid(Reservation reservation, ConstraintValidatorContext context) {
|
public boolean isValid(Reservation reservation, ConstraintValidatorContext context) {
|
||||||
|
|
||||||
if (reservation == null) {
|
if (reservation == null) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(reservation instanceof Reservation)) {
|
if (!(reservation instanceof Reservation)) {
|
||||||
|
|
Loading…
Reference in New Issue