title: java duplicated code in enum
body: <p>I have duplicated code in my program, I have enums that load values from a property file, I want make my code to be cleaner.</p>
  
  <p>Maybe an <code>Interface</code> can be the solution but I can't declare a non final variable.</p>
  
  <p>This is an example:</p>
  
  <pre><code>public enum AlertMessageEnum{
      //
      OUTPUT_FOLDER_EXISTS, 
      ...
      CONFIG_FILE_IS_MISSING;
      // the file path to load properties
      private static final String PATH= "/i18n/alertDialogText.properties";
      private static Properties   properties;
      private String value;
  
      public void init() {
          if (properties == null) {
              properties = new Properties();
              try {
                  properties.load(AlertMessageEnum.class.getResourceAsStream(PATH));
              }
              catch (Exception e) {
                  throw new RthosRuntimeException(e);
              }
          }
          value = (String) properties.get(this.toString());
      }
  
      public String getValue() {
          if (value == null) {
              init();
          }
          return value;
      }
  }
  
  public enum ConverterErrorEnum{
      INVALID_EXTRACTION_PATH,
      ...
      PATIAL_DATA_GENERATED;
  
      private static final String PATH= "/i18n/converterErrorText.properties";
      private static Properties   properties;
      private String value;
  
      ...
  
  }
  </code></pre>