title: @JsonValue on an enum field, when this enum used as map key
body: <pre><code>public enum ClusterType {
      TEMPERATURE("0402"),
      HUMIDITY("0405"),
      ENERGY_DETAILS("0702"),
      SMART_SOCKET_STATUS("0006"),
      ALARMED("0500");
  
      private String value = null;
  
      ClusterType(String byteStr) {
          this.value = byteStr;
      }
  
      @JsonCreator
      public static ClusterType fromValue(final String val){
          return (ClusterType) CollectionUtils.find(Arrays.asList(ClusterType.values()), new Predicate() {
              public boolean evaluate(Object object) {
                  ClusterType candidate = (ClusterType) object;
                  return StringUtils.equals(candidate.value, val);
              }
          });
      }
  
      @JsonValue
      public String getValue(){
          return value;
      }
  
      public byte[] get() {
          return ByteUtils.hexStringToByteArray(value);
      }
  
      public boolean equals(String cluster) {
          return StringUtils.equals(cluster, value);
      }
  }
  </code></pre>
  
  <p>I have the above enumeration with </p>
  
  <blockquote>
    <p>@JsonValue
        public String getValue(){
            return value;
        }</p>
  </blockquote>
  
  <p>part and a sample test class like...</p>
  
  <blockquote>
    <p>public class Foo {</p>
  
  <pre><code>public static void main(String[] args) {
      try {
          ObjectMapper objectMapper = new ObjectMapper();
  
          ClusterType []arrayRep = new ClusterType[]{ClusterType.ALARMED, ClusterType.TEMPERATURE};
  
          Map&lt;String, ClusterType&gt;  mapRepAsValue = new HashMap&lt;&gt;();
          mapRepAsValue.put("1", ClusterType.ALARMED);
          mapRepAsValue.put("2", ClusterType.TEMPERATURE);
  
          Map&lt;ClusterType, String&gt;  mapRepAsKey = new HashMap&lt;&gt;();
          mapRepAsKey.put(ClusterType.ALARMED, "1");
          mapRepAsKey.put(ClusterType.TEMPERATURE, "2");
  
          System.out.println(objectMapper.writeValueAsString(arrayRep));
          System.out.println(objectMapper.writeValueAsString(mapRepAsValue));
          System.out.println(objectMapper.writeValueAsString(mapRepAsKey));
  
      } catch (JsonProcessingException e) {
          e.printStackTrace();
      }
  } }
  </code></pre>
  </blockquote>
  
  <p>This test class prints out </p>
  
  <pre><code>["0500","0402"]
  {"2":"0402","1":"0500"}
  {"TEMPERATURE":"2","ALARMED":"1"}
  </code></pre>
  
  <p>@JsonValue is not working when used on an enum field which is a key of map.</p>
  
  <p>Is there a way to use this enum as key when serializing maps?</p>
  
  <p>Thanks. </p>