Skip to content

Commit

Permalink
#143 [fix] 0과 다른 값이 같이 있을때 false
Browse files Browse the repository at this point in the history
  • Loading branch information
hellozo0 committed Jan 16, 2024
1 parent 53847ea commit 26262aa
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public boolean isValid(List<Long> preferRegions, ConstraintValidatorContext cont

if (preferRegions == null || preferRegions.isEmpty()) return false;
if (preferRegions.size() != new HashSet<>(preferRegions).size()) return false;
if (preferRegions.stream().filter(p -> p == 0).count() <= 1 && preferRegions.stream().anyMatch(p -> p != 0)) return false;
if (preferRegions.stream().filter(p -> p == 0).count() == 1 && preferRegions.stream().anyMatch(p -> p != 0)) return false;
if (!preferRegions.stream().allMatch(p -> p >= 0 && p <= 25)) return false;
if (preferRegions.size() > 3 ) return false;

Expand Down

0 comments on commit 26262aa

Please sign in to comment.