title: Set Enum constant values as hashmap key in java
body: <p>I have below enum defined. I have declared a Hashmap with its key as enum. When I am trying to put enum constant value as key in hashmap, key is getting stored with &quot;QUESTION_FIRST&quot; while I want it to be &quot;firstQuestion&quot;</p>
  <pre><code>@Getter
  public enum Question {
  
      QUESTION_FIRST(&quot;firstQuestion&quot;),
      QUESTION_SECOND(&quot;secondQuestion&quot;);
  
      private final String value;
  
      Question(String value){
          this.value = value;
      }
  
      public String getValue(){
          return value;
      }
  }
  
  public void testMethod(){
  Map&lt;Question, Integer&gt; map = new HashMap&lt;&gt;();
  map.put(QUESTION_FIRST.getValue(), 1);
  }
  </code></pre>