title: Check null value of map
body: <p>I am getting <code>map</code> as result and when I am getting value I need to convert it to <code>String</code> like below:</p>
  
  <pre><code>a.setA(map.get("A").toString());
  </code></pre>
  
  <p>but if it returns <code>null</code> than it throws <code>nullPointerException</code>, so I change it with below:</p>
  
  <pre><code>a.setA(map.get("A")!=null?map.get("A").toString():"");
  </code></pre>
  
  <p>but there are more than 20 fields for that I am doing the same so I just want to do like below:</p>
  
  <pre><code>String val = "";
  a.setA(val=map.get("A")!=null?val.toString():"");
  </code></pre>
  
  <p>but it returns <code>blank</code> all time, I have just simple question is can't I use variable like this? or is there any other option for doing the same?</p>