package in.twizmwaz.cardinal.module.modules.filter.type.logic;

import in.twizmwaz.cardinal.module.ModuleCollection;
import in.twizmwaz.cardinal.module.modules.filter.FilterModule;
import in.twizmwaz.cardinal.module.modules.filter.FilterState;

import static in.twizmwaz.cardinal.module.modules.filter.FilterState.ALLOW;

public class AnyFilter extends FilterModule {

    private final ModuleCollection<FilterModule> children;

    public AnyFilter(final String name, final ModuleCollection<FilterModule> children) {
        super(name);
        this.children = children;
    }

    @Override
    public FilterState evaluate(final Object object) {
        for (FilterModule child : children) {
            if (child.evaluate(object).equals(ALLOW)) return ALLOW;
        }
        return ALLOW;
    }

}

@@ -313,16 +313,91 @@
 e.ALLOW;
+%0Aimport static in.twizmwaz.cardinal.module.modules.filter.FilterState.DENY;
 %0A%0Apublic
@@ -852,28 +852,27 @@
      return 
-ALLOW
+DENY
 ;%0A    %7D%0A%0A%7D%0A

Fix logic in any logic filter