title: Java switch using methods
body: <p>I am wanting to call methods from an object from a switch statement.<br>
  Here, I am switching on a <code>String</code>:</p>
  
  <pre><code>switch (properties.getProperty("my.property")) { // getProperty() retuns a String
    case contains("something"):
      doSomething();
      break;
  }
  </code></pre>
  
  <p>Can I execute methods of the <code>switch</code>'ed object like this?  Basically I'm trying to avoid doing:</p>
  
  <pre><code>case properties.getProperty("my.property").contains("something"):
  </code></pre>
  
  <p>I'm pretty sure it's a lost cause, but perhaps I've missed something...</p>
  
  <p>I've tried using <code>contains()</code> and <code>.contains()</code> to no avail.  Should I just stop trying to be lazy?  Or is there a way to do this?</p>