title: Association Object-Enum, which is more efficient?
body: <p>Let's say I have the following enum:</p>
  
  <pre><code>public enum Example{
  
  A,
  B,
  C,
  D,
  E;
  
  }
  </code></pre>
  
  <p>I need an association between an Object and the enum above.
  In my specific case, one object must have only one <code>Example</code> association, except for <code>Example.B</code> and <code>Example.C</code>, because an Object could eventually have these two associations.</p>
  
  <p>Right now my solution is: I have created an object wrapper of a five booleans, each boolean representing an enum. When it's true it means there is an association with the represented Example constant.</p>
  
  <p>In the end I have an association between the Object and the Wrapper.
  The thing is that I believe it's unnecessary to carry around these five booleans, because in most cases only boolean will be true and in very few cases only two booleans will be true. But never more than two.</p>
  
  <p>Then I thought that maybe an association between an Object and an <code>ArrayList&lt;Example&gt;</code> would be more appropriate. Or maybe even better an array <code>Example[]</code> of size 2.</p>
  
  <p>What do you think?</p>
  
  <p>Please, if you have any different suggestions let me know.</p>