title: How to create a map with enum values in java?
body: <p>I need to validate the value of a parameters passed as part of REST API. These parameters are a fixed set of values. I thought of using a map having parameter name as key and enum as value. So I can check if the value sent in REST API is one of the enum keys.</p>
  
  <p>But I am not able to create a Map with String key and enum value in java, tried creating Map and then putting and enum as value, but it fails.</p>
  
  <pre><code>class Validation {
      enum Type {
          INTERNAL,
          EXTERNAL
      }; 
  }
  
  Map&lt;String, Object&gt; validationMap = new HashMap&lt;String, Object&gt;();
  validationMap.put("type", Validation.Type);
  </code></pre>
  
  <p>This is throwing an error that type is not defined.</p>