title: Proper design pattern for passing flags to an object
body: <p>In C I've done this sort of thing</p>
  
  <pre><code>enum { USE_COKE = 1,
          USE_PEPSI = 2,
          USE_JUICE = 4,
          USE_WATER = 8 };
  
   int makeDrink(int flags);
  
   //...
  
   int rcode = makeDrink(USE_COKE | USE_JUICE | USE_WATER);
  </code></pre>
  
  <p>I know this is pretty standard, it's also used in <code>iostream</code> for instance.  I'm wondering how to translate this design pattern into Java or OOP?  I'm <em>pretty</em> sure polymorphism is not the way to go here since it'd be better for my code to have an <code>if(flag_is_set)</code> block than rewrite much of the routine.  Is there a utility <code>Flags</code> class, or a preferred way to do this using a configuration object, or an <code>enum</code>, or a bunch of ints, etc.</p>