title: In Java, how to dynamically create a relational expression, execute it and get the final boolean result
body: <p>I've 2 fields in DB e.g. <code>senti_op</code> and <code>senti_score</code> both of which are Strings . <code>senti_score</code> contains strings of value <code>Double</code> i.e <code>25.00</code>, <code>30.50</code> etc whereas the <code>senti_op</code> contains strings of relational operators like <code>&gt;=</code>, <code>&gt;</code>, <code>&lt;</code> etc.</p>
  
  <p>In Java, I want to do like this: </p>
  
  <ul>
  <li>for <code>senti_op</code> <code>&gt;=</code> , I want the logical expression as: <code>if ("some double value" &gt;= senti_score)</code></li>
  <li>for <code>&lt;</code> , I want <code>if ("some double value" &lt; senti_score)</code></li>
  </ul>
  
  <p>I'm trying to form these relational expression and get their <code>boolean</code> result to be used later by other part of the code. </p>
  
  <p>Please provide compilable Java example code. I'm trying to avoid writing lots of if-else statements using string comparison for each operator and evaluate the values and looking for small and working solution.</p>
  
  <p>I'm pretty new to such things and would appreciate all your help. </p>