title: Replace if-elses by a config file
body: <p>Consider a Java function as follows -</p>
  <pre><code>public MutablePair&lt;List&lt;String&gt;,Boolean&gt; getItemPair(Map&lt;String,Object&gt; myMap){
      MutablePair&lt;List&lt;String&gt;,Boolean&gt; SampleList(Map&lt;String,Object&gt; objectMap){
      MutablePair&lt;List&lt;String&gt;,Boolean&gt; finalMutablePair = new MutablePair&lt;&gt;;
      List&lt;String&gt; FinalList = new ArrayList&lt;&gt;();
      Boolean b = true;
      if(objectMap.get(&quot;a&quot;).toString().contains(&quot;Animal&quot;)){
          FinalList.add(&quot;Is an Animal&quot;);
          if(objectMap.get(&quot;w&quot;).toString().contains(&quot;Wild&quot;)){
               FinalList.add(&quot;Is a wild Animal&quot;);
               if(objectMap.get(&quot;b&quot;).toString().contains(&quot;Beautiful&quot;)){
                  FinalList.add(&quot;Is a beautiful Animal&quot;);
               }
               else{
                  FinalList.add(&quot;Is not beautiful Animal&quot;);
                  b = false;
               }
              }
          else{
               FinalList.add(&quot;Is not a wild Animal&quot;);
               b= false;
              }
          }
      else{
          FinalList.add(&quot;Is not an Animal&quot;);
          b = false;
        }
          finalMutablePair.first = FinalList;
          finalMutablePair.second = b;
          return finalMutablePair;
      }
  }
  </code></pre>
  <p>There are nested if elses up to 3 levels in this case. But in actual use cases it can be well more than 3. I am aiming to define the conditions in a config file , to remove these nested if elses. I am thinking of defining a json file or jsonpath or something on these lines, so that a Map can be given as the input and List of Strings and a Boolean can be returned as the output. Also the config file can be used at many other places, therefore removing redundant code.
  Can someone suggest me with an answer, or a code link , how can this be achieved? Looking for defining conditions in a Config file</p>