gitmyhub

java-filter-engine

Java ★ 0 updated 2mo ago

The java-filter-engine library helps you decide whether something should be allowed or blocked based on simple text rules. Think of it as a bouncer for your application: you give it a list of attributes (like a phone number or a message source) and a set of rules, and it tells you "yes, let this through" or "no, block it."

The engine uses a straightforward two-step process. First, it checks your deny rules to see if anything matches a blocklist. If nothing is denied, it then checks the allow rules. If neither set of rules matches, it blocks the item by default — a "better safe than sorry" approach. The matching itself uses familiar wildcard patterns, so you can say "block anything containing the word spam" or "allow anything starting with 555." It's also case-insensitive, so "Spam" and "spam" are treated the same way.

This would be useful for anyone building a system that needs to screen incoming data. For example, if you're building a messaging app and want to automatically filter out texts from certain number patterns, or if you're processing form submissions and want to reject entries that contain flagged keywords, this library handles that logic for you without needing to write it from scratch.

One notable thing about the project is that it's a pure Java library with zero external dependencies, meaning it's lightweight and won't pull in extra code that could complicate your project. However, it's explicitly labeled for educational or experimental use rather than production systems, so it's best suited for learning purposes, prototyping, or side projects rather than mission-critical applications.