title: Best way to avoid multiple parallel if else loop in java 8
body: <p>What is the best way to avoid multiple parallel if-else loop. I tried with <code>switch</code> statement as well, but again that doesn't look readable. I have hundreds of such statements:</p>
  
  <pre><code>public static Map getKqvSecureNodeResponse(Sample secureNodeData, Map&lt;String, Object&gt; map) {
      if(map.containsKey(Constants.NAME_KQV)) {
          map.put(Constants.NAME_KQV, secureNodeData.getNodename());
      }
      if(map.containsKey(Constants.SPOV)) {
          map.put(Constants.SPOV, secureNodeData.getOverride());
      }
      if(map.containsKey(Constants.SPEP)) {
          map.put(Constants.SPEP, secureNodeData.getEnabledProtocol());
      }
      if(map.containsKey(Constants.SPTO)) {
          map.put(Constants.SPTO, secureNodeData.getAuthTimeout());
      }
      if(map.containsKey(Constants.TLCN)) {
          map.put(Constants.TLCN, secureNodeData.getCommonName());
      }
      if(map.containsKey(Constants.SEDT)) {
          map.put(Constants.SEDT, secureNodeData.getEncryptData());
      }
      if(map.containsKey(Constants.TLCF)) {
          map.put(Constants.TLCF, secureNodeData.getKeyCertLabel());
      }
      if(map.containsKey(Constants.TLCL)) {
          map.put(Constants.TLCL, secureNodeData.getCipherSuites());
      }
      return map;
  }
  </code></pre>
  
  <p>Please note that I have to invoke different getter of secureNodeData for every check.</p>