I need to implement a filter function using Hibernate Conjunction or Criterion that:
Accepts a String containing any of the letters 'A', 'F', 'C', 'I' at most one time in a random order.
Returns a Hibernate criterion that evaluates as true if and only if the input occurrences match the String applied upon.
E.g.:
1) Input 'AFCI' should return true only if applied on 'AFCI', 'ACIF', 'AICF', 'FIAC', etc.
2) Input 'AI' should return true only if applied on 'AI' or 'IA'. Should return false if the field is 'AIC', 'AIF', 'ACI', 'AFCI', etc.
3) Input 'F' should return true only if applied on 'F'. Should return false in any other case, even if it contains 'F', such as 'AF' or 'FC'.
Any help will be deeply appreciated, because I'm stuck in this for too long.