title: how can I add a list of parameters determined by fields to a single "if" generic statement?
body: <p>I'm refactoring a test and its already working alright but I've stumble into the following: I got  list of parameters that represents fields on the screen, for each one there is a "if" condition, if that parameter is called I pass some values to a post method. I wanna make one generic "if" that checks one parameter and goes on to the next and so. </p>
  
  <pre><code>    public object = constructor.ifRequired("properties.key.to.field");
  public object2 = constructor.ifRequired("properties.key.to.field");
  public object3 = constructor.ifRequired("properties.key.to.field");
  
  //post implementation
  
  if(object) {
      post.param = "param1", "param2";
  }
  if(object2) {
      post.param = "param3", "param4";
  }
  if(object2) {
      post.param = "param5", "param6";
  }
  </code></pre>
  
  <p>I wanna make it work like:</p>
  
  <pre><code>//post implementation
  
  if(objectx) {
      post.param = "getParamForObjectx", "getParamForObjectx";
  }
  </code></pre>