I'm looking for a good data structure to represent strings of the form:
Domain:Key1=Value1,Key2=Value2...
Each "Domain" can contain the following pattern characters -
*
,?
(*
- 0 or more characters,?
- 0 or 1 character)Each "Key" can contain the following pattern characters -
*
,?
(*
- 0 or more characters,?
- 0 or 1 character)Each "Value" can contain the following pattern characters -
*
,?
(*
- 0 or more characters,?
- 0 or 1 character)
Examples:
JBoss:*
*:*
JBoss:type=ThreadPool,*
JBoss:type=Thread*,*
JB*:name=http1,type=ConnectionPool
If you are familiar with JMX ObjectName's then essentially this is the ObjectName pattern.
I'm looking for ways to easily store a rule corresponding to each pattern and be able to quickly delete,update and add new rules.
I started out by using a Prefix Trie, but got stuck with the pattern characters *
, ?
.