  <template name="enum" value="/**&#10; * This implements a type-safe enum pattern.&#10; * @author &lt;a href=&quot;$AUTHOR_EMAIL$&quot;&gt;$AUTHOR_NAME$&lt;/a&gt;&#10; */&#10;public static final class $ENUM_NAME$ implements Serializable, Comparable {&#10;&#10;    private static int nextOrdinal = 0;&#10;    private static List TEMP_VALUES = new ArrayList();&#10;&#10;    // Add all of your enum values here&#10;    public static final $ENUM_NAME$ $EXAMPLE1$ = new $ENUM_NAME$(&quot;$EXAMPLE1$&quot;);&#10;    public static final $ENUM_NAME$ $EXAMPLE2$ = new $ENUM_NAME$(&quot;$EXAMPLE2$&quot;);&#10;    public static final $ENUM_NAME$ $EXAMPLE3$ = new $ENUM_NAME$(&quot;$EXAMPLE3$&quot;);&#10;    public static final $ENUM_NAME$ $EXAMPLE4$ = new $ENUM_NAME$(&quot;$EXAMPLE4$&quot;);&#10;    public static final $ENUM_NAME$ $EXAMPLE5$ = new $ENUM_NAME$(&quot;$EXAMPLE5$&quot;);&#10;    $END$&#10;&#10;    // VALUES must be located after all of the enum value declarations &#10;    //  otherwise the values will only be added to TEMP_VALUES&#10;    public static final List VALUES = Collections.unmodifiableList(TEMP_VALUES);&#10;&#10;    private transient final String name;&#10;    public final int ordinal = nextOrdinal++;&#10;&#10;    /**&#10;     * Private contructor for type-safe enumeration&#10;     * @param name&#10;     */&#10;    private $ENUM_NAME$(String name) {&#10;        this.name = name;&#10;        TEMP_VALUES.add(this);&#10;    }&#10;&#10;    public String toString() {&#10;        return this.name;&#10;    }&#10;&#10;    public int compareTo(Object obj) {&#10;        return this.ordinal - (($ENUM_NAME$) obj).ordinal;&#10;    }&#10;&#10;    private static final long serialVersionUID = 0l;&#10;    private Object readResolve() throws ObjectStreamException {&#10;        return VALUES.get(ordinal);&#10;    }&#10;&#10;    public int getOrdinal(){&#10;        return this.ordinal;&#10;    }&#10;}&#10;" description="Type-safe Enumeration" toReformat="false" toShortenFQNames="true">
    <variable name="AUTHOR_EMAIL" expression="" defaultValue="&quot;me@example.com&quot;" alwaysStopAt="true" />
    <variable name="AUTHOR_NAME" expression="" defaultValue="&quot;My Name Here&quot;" alwaysStopAt="true" />
    <variable name="ENUM_NAME" expression="" defaultValue="&quot;MyEnum&quot;" alwaysStopAt="true" />
    <variable name="EXAMPLE1" expression="" defaultValue="&quot;ONE&quot;" alwaysStopAt="true" />
    <variable name="EXAMPLE2" expression="" defaultValue="&quot;TWO&quot;" alwaysStopAt="true" />
    <variable name="EXAMPLE3" expression="" defaultValue="&quot;THREE&quot;" alwaysStopAt="true" />
    <variable name="EXAMPLE4" expression="" defaultValue="&quot;FOUR&quot;" alwaysStopAt="true" />
    <variable name="EXAMPLE5" expression="" defaultValue="&quot;FIVE&quot;" alwaysStopAt="true" />
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="JAVA_COMMENT" value="false" />
      <option name="JAVA_STRING" value="false" />
      <option name="XML" value="false" />
      <option name="HTML" value="false" />
      <option name="JSP" value="false" />
      <option name="COMPLETION" value="false" />
      <option name="OTHER" value="false" />
    </context>
  </template>

