title: How do I create an enum in scala that has an extra field
body: <p>In Java I have something like this</p>
  
  <pre><code>public enum FlatFileHeaderMapping {
  
     HEADER_EL(1),
     HEADER_RESERVED1(5),
     HEADER_RESERVED2(2),
     HEADER_MESSAGE_TYPE(4)
  
     public final int fieldSize;
  
      private FlatFileHeaderMapping(int fieldSize) {
          this.fieldSize = fieldSize;
     }
  
  }
  </code></pre>
  
  <p>which I can then use it place each line into a map and later access the keys in the map via this enum (like symbols)</p>
  
  <p>Enumeration does not have this quality as far as I can see, and case classes are not ordered like the enum declarations - so cannot be used to match a record layout as shown above.  At least not without the support of an ordered collection.</p>
  
  <p>I could be missing something obvious, hence the question!</p>
  
  <p>Thanks</p>
  
  <p>Ray</p>