title: Enum with constructor in switch-statement
body: <p>It might be a silly question, but I can't understand why it doesn't work:</p>
  
  <pre><code>public class MainClass {
  
      public enum Header{
          ValueType("Value Type"),
          LimitType("Limit Type"),
          Currency("Currency");
  
          Header(String value) {
              this.value = value;
          }
  
          private final String value;
  
          public String getValue(){
              return value;
          }
      }
  
      static void getHeaderValue (String headerValue) {
  
          switch (headerValue) {
              case Header.LimitType.getValue() :
                  System.out.println(Header.LimitType.getValue());
                  break;
              case Header.ValueType.getValue() :
                  System.out.println(Header.ValueType.getValue());
                  break;
              case Header.Currency.getValue() :
                  System.out.println(Header.Currency.getValue());
                  break;
              default:
                  break;
          }
      }
  }
  </code></pre>
  
  <p>The compiler notices that "constant string expression required". Thank you in advance for explanation.</p>