Skip to content

Commit

Permalink
Tidy Validation Adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
SentryMan authored Jan 30, 2025
1 parent 9d353b8 commit ebe8ae2
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,7 @@ default ContainerAdapter<T> optional() {
*/
default ValidationAdapter<T> andThen(ValidationAdapter<? super T> after) {
Objects.requireNonNull(after, "after cannot be null");
return (value, req, propertyName) -> {
if (validate(value, req, propertyName)) {
return after.validate(value, req, propertyName);
}
return false;
};
return (value, req, propertyName) -> validate(value, req, propertyName) && after.validate(value, req, propertyName);
}

/**
Expand Down

0 comments on commit ebe8ae2

Please sign in to comment.