title: How to make copies of an enum without copy pasting code?
body: <p>I am making enums to assist in reading and handling excel imports of products with components.</p>
  
  <p>I have currently made the following two enums.</p>
  
  <pre class="lang-java prettyprint-override"><code>    public enum ProductSheetColumns {
          PRODUCT_ID("Product ID", "A"),
          PRODUCT_NAME("Product Name", "B"),
          COST("Cost", "C");
  
          private String columnName;
          private String columnIndex;
  
          ProductSheetColumns(String columnName, String columnIndex) {
              this.columnName = columnName;
              this.columnIndex = columnIndex;
          }
  
          public String sheetName() {
              return "Product Sheet";
          }
  
          public String columnName() {
              return columnName;
          }
  
          public String columnIndex() {
              return columnIndex;
          }
      }
  
      public enum ComponentSheetColumns {
          PRODUCT_ID("Product ID","A"),
          COMPONENT_ID("Component ID","B"),
          QUANTITY("Quantity","C");
  
          private String columnName;
          private String columnIndex;
  
          ComponentSheetColumns(String columnName, String columnIndex) {
              this.columnName = columnName;
              this.columnIndex = columnIndex;
          }
  
          public String sheetName() {
              return "Component Sheet";
          }
  
          public String columnName() {
              return columnName;
          }
  
          public String columnIndex() {
              return columnIndex;
          }
      }
  </code></pre>
  
  <p>As you can see, except for the naming of the constants and enum names, they are largely the same enum.</p>
  
  <p>Is there any way to reduce the code to something like this while keeping the methods?</p>
  
  <pre class="lang-java prettyprint-override"><code>    public enum ProductSheetColumns {
          PRODUCT_ID("Temporary Product ID", "A"),
          PRODUCT_NAME("Product Name", "B"),
          ADDITIONAL_COST("Additional Cost", "C");
      }
  
      public enum ComponentSheetColumns {
          PRODUCT_ID("Product ID","A"),
          COMPONENT_ID("Component ID","B"),
          QUANTITY("Quantity","C");
      }
  </code></pre>
  
  <p>I have tried to create an interface but all that does is make me have to add an @Override tag to the enum class. I cannot seem to extend the class or inherit the enum constructor.</p>
  
  <p>EDIT: To clarify the above code sample, the below code does not work but I want to know if it's possible to do something to the same effect with enums:</p>
  
  <pre class="lang-java prettyprint-override"><code>    public enum ProductSheetColumns extends ExcelSheetColumns {
          PRODUCT_ID("Temporary Product ID", "A"),
          PRODUCT_NAME("Product Name", "B"),
          ADDITIONAL_COST("Additional Cost", "C");
  
          ProductSheetColumns(String columnName, String columnIndex) {
              super(columnName, columnIndex);
          }
  
          public String sheetName() {
              return "Product Sheet";
          }
      }
  
      public enum ComponentSheetColumns extends ExcelSheetColumns {
          PRODUCT_ID("Product ID","A"),
          COMPONENT_ID("Component ID","B"),
          QUANTITY("Quantity","C");
  
          ProductSheetColumns(String columnName, String columnIndex) {
              super(columnName, columnIndex);
          }
  
          public String sheetName() {
              return "Component Sheet";
          }
      }
  
  
      public enum ExcelSheetColumns {
          ;
  
          private String columnName;
          private String columnIndex;
  
          ExcelSheetColumns(String columnName, String columnIndex) {
              this.columnName = columnName;
              this.columnIndex = columnIndex;
          }
  
          public String columnName() {
              return columnName;
          }
  
          public String columnIndex() {
              return columnIndex;
          }
      }
  </code></pre>