title: Adding HashMap instead of using switch-case?
body: <p>So I have a Java class which has a number of switch cases which I now want to replace with HashMap, because of better performance. So earlier my switch case was something like : </p>
  
  <pre><code>SomeClass someMethod =  new SomeClass();
  
    if (!("".equals(varA))) {
                  switch (varA) {
                  case "3":
                      someMethod.setValue("abcd");
                      break;
                  case "91":
                      someMethod.setValue("defgh");
                      break;
                          }
  </code></pre>
  
  <p>Now I want to replace this with the HashMap. I am struggling with adding the object in the put.</p>
  
  <pre><code>HashMap&lt;String, SomeClass&gt; hashMap= new HashMap();
  hashMap.put("3", ?????);
  </code></pre>
  
  <p>What should I write there so my object sets the value ?</p>