title: How to use a bitwise operator to pass multiple Integer values into a function for Java?
body: <p>In application frameworks I keep seeing frameworks that allow you to pass in multiple Int values (generally used in place of an enum) into a function. </p>
  
  <p>For example:</p>
  
  <pre><code>public class Example
  { 
      public class Values
      {
          public static final int ONE = 0x7f020000;
          public static final int TWO = 0x7f020001;
          public static final int THREE = 0x7f020002;
          public static final int FOUR = 0x7f020003;
          public static final int FIVE = 0x7f020004;
      }
  
      public static void main(String [] args)
      {
          // should evaluate just Values.ONE
          Example.multiValueExample(Values.ONE);
  
          // should evalueate just values Values.ONE,  Values.THREE, Values.FIVE
          Example.multiValueExample(Values.ONE | Values.THREE | Values.FIVE);
  
          // should evalueate just values Values.TWO , Values.FIVE
          Example.multiValueExample(Values.TWO | Values.FIVE);
      }
  
      public static void multiValueExample(int values){
          // Logic that properly evaluates bitwise values
          ...
      }
  }
  </code></pre>
  
  <p>So what logic should exist in multiValueExample for me to properly evaluate multiple int values being passed in using the bitwise operator? </p>