title: using inner classes in Java - enum
body: <p>I have a very specific issue that has to do with an inner class. Let me show you some sample code:</p>
  
  <pre><code>class Foo {
      MYOPTIONS temp;
  
      public static enum MYOPTIONS {
          OPTION1, OPTION2, OPTION3;
      } 
  }
  </code></pre>
  
  <p>So this enumeration is inside the class Foo. Now what I want to do is set the temp variable as one of the three options, but do that outside the class Foo, let's say from a class called External. Unfortunately I cannot have a set method to do that because <code>External.setTemp (MYOPTIONS.OPTION1)</code> is not valid, as the enum is not visible in class external.
  So the only thing I could come up with is have three methods in class Foo:</p>
  
  <pre><code>public void setTempOption1 () {this.temp=MYOPTIONS.OPTION1;}
  public void setTempOption2 () {this.temp=MYOPTIONS.OPTION2;}
  public void setTempOption3 () {this.temp=MYOPTIONS.OPTION3;}
  </code></pre>
  
  <p>Obviously the other option is to change the enumeration and not have it as an inner class.
  Are there any other options that I am missing?
  Thanks</p>