title: Java: enum toString()
body: <p>I have created an enum and I'm trying to allow my enum to support a String.format operation that gets unlimited number of parameters are return a string.
  I only managed to return an object and after using this method I have to do a <code>toString()</code>/casting. I am guessing there's a more "clean" way to do it, or maybe to override better the <code>toString()</code> method. Basically, I wanted to support the <code>toString()</code> method but sadly didn't manage to do that so I created this method.  As you can see it's named <code>text(..)</code> and not <code>toString()</code>.</p>
  
  <p>How can I do this better?  The ideal solution I wanted was something like <code>toString(..)</code> which returns a String.</p>
  
  <pre><code>public enum MY_ENUM {
  
      VALUE_A("aaa %s"), VALUE_B("bbb %s");
  
      private String text;
  
      MY_ENUM(String text) {
          this.text = text;
      }
  
      public String text() {
          return this.text;
      }
  
      public Object text(final Object... o) {
          return new Object() {
              @Override
              public String toString() {
                  return String.format(text(), o);
              }
          };
      }
  }
  </code></pre>