Skip to content

Commit

Permalink
try to fix tests rev.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MarieTask committed Jan 27, 2024
1 parent 2ae233b commit b7ab506
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/src/main/java/hexlet/code/schemas/BaseSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ protected final void addCondition(Predicate<Object> condition) {
conditions.add(condition);
}
public final boolean isValid(Object obj) {
for (Predicate<Object> c: conditions) {
if (!c.test(obj) && !isRequired) {
return true;
}
if (!isRequired) {
return true;
}
return (!conditions.stream().allMatch(condition -> condition.test(obj)));
}
Expand Down

0 comments on commit b7ab506

Please sign in to comment.