This question already has an answer here:
I have a string conditions logic that retrieves values for a
Map<String,Boolean> and checks if logic is true or false.
For example my logic looks like:
Being A => AND and O => OR.
And my map has this kind of structure: