title: Append to a string if result is not null in one line? (clean/good looking)
body: <p>I have an object of with 5 internal string variables, but 3 of them are optional. I could create a constructor for each possible combination or I could call general constructor and pass it some empty strings. The later case is interesting to me, if I when calling the constructor I could do something like:</p>
  
  <pre><code>String a = "Mandatory";
  ...
  String e = "" + getVariableE(); //getVariableX() could return null, 
                                  //then it would be "".
                                  //This is a "long" fetch statement.
  
  new objectA(a, b, c, d, e); 
  </code></pre>
  
  <p>Another other option:</p>
  
  <pre><code>String d = "";
  String e = "";
  if(getVariableD!=null)  //Remember pretty long fetch statement (ugly looking)
       d = getVariableD();
  if(getVariableE!=null)
      e = getVariableE();
  
  new objectA(a, b, c, d, e);
  </code></pre>
  
  <p>I do not see a away to use multiple constructors without the use of multiple if statements.</p>
  
  <pre><code>new objectA(a, b, c);
  new objectA(a, b, c, d)
  </code></pre>
  
  <p>I think the constructor may not be a factor here, but only the way the lines are set to "" or to something; nevertheless, I left it in case i miss something. </p>
  
  <p>This is the simple objectA class</p>
  
  <pre><code>public class objectA {
  String a; //Needed
  String b; //Needed
  String c; //Optional
  String d; //Optional
  String e; //Optional
  /*
   * Possible constructor
  */
      void object(String a, String b, String c, String d, String e) {
      this.a = a;
      ...
      this.e = e;
      }
  </code></pre>
  
  <p>Note: getVariableX() gets an attribute from an XML file, so I could force that it MUST contain a string, but I do not think this would be nice. Better give flexibility to the XML file. </p>