title: Compact Java syntax for conditional arguments?
body: <p>What is the best (most compact) way to hand this situation:
  One or more arguments to a method call depends on some condition, while the rest of the arguments are identical?</p>
  
  <p>For example-- you want to</p>
  
  <pre><code>DeathRay mynewWpn = new DeathRay(particle.proton, chassisColor.BLACK, oem.ACME)
  </code></pre>
  
  <p>if</p>
  
  <pre><code>enemy_composition == nature.ANTIMATTER
  </code></pre>
  
  <p>but </p>
  
  <pre><code>DeathRay mynewWpn = new DeathRay(particle.anti-proton, chassisColor.BLACK, oem.ACME)
  </code></pre>
  
  <p>if </p>
  
  <pre><code>enemy_composition == nature.MATTER
  </code></pre>
  
  <p>Obviously you can <code>if-else</code> but it looks unnecessarily long when there are a lot of arguments or more than one conditional argument.  I have also done this creating an argument with an <code>if-else</code> beforehand and then calling the method.  Again, that seems kind of clunky.  Is there some sort of inline syntax similar to an Excel if-statement?</p>