Is there a Java library I can use to convert conditions into actual code instead of using a lot of case statement for all the cominations?
Eg: "GT value1 LT value2" and it should return true/false based on the input values I give.
Is there a Java library I can use to convert conditions into actual code instead of using a lot of case statement for all the cominations?
Eg: "GT value1 LT value2" and it should return true/false based on the input values I give.
I guess you need to look at ANTLR framework.
Just for the headsup:
This isn't a trivial task, what you're asking for is a scripting language interpreter for Java.
You could look at OGNL or the JSR api. These both require fairly extensive knowledge of syntax; so depending on what you want to do may not fill the brief.
However, without some structured syntax you are relying wholly on the structure of the English language - you are getting into the realms of NLP.
You could just use a scripting language like Groovy if all you are looking for is a way to change behaviour at runtime.