Skip to content

Commit

Permalink
[java] Cleanup isAllowed method as it can be much more simple
Browse files Browse the repository at this point in the history
  • Loading branch information
hazendaz committed Feb 14, 2023
1 parent 392b51e commit 415e750
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,10 @@ public boolean getPredicate() {
* Simple policy decision based on whether a matcher succeeded.
*
* @param matched - boolean result of some matching operation.
* @return
* @return true, if is allowed
*/
public boolean isAllowed(final boolean matched) {
if (matched && allowed) {
return true;
} else if (!matched && !allowed) {
return true;
} else {
return false;
}
return (matched && allowed) || (!matched && !allowed);
}

public static Rule valueOf(final boolean allowed) {
Expand Down

0 comments on commit 415e750

Please sign in to comment.