package org.drools.builder.conf;

/**
 * A class for the language level configuration.
 */
public class LanguageLevelOption implements SingleValueKnowledgeBuilderOption {

    private static final long serialVersionUID = 510l;

    /**
     * The property name for the language level
     */
    public static final String PROPERTY_NAME = "drools.lang.level";

    private final int languageLevel;

    /**
     * Private constructor to enforce the use of the factory method
     * @param languageLevel
     */
    private LanguageLevelOption( int languageLevel ) {
        this.languageLevel = languageLevel;
    }

    /**
     * This is a factory method for this LanguageLevel configuration.
     * The factory method is a best practice for the case where the
     * actual object construction is changed in the future.
     *
     * @param languageLevel the level of the language to be used
     *
     * @return the actual type safe LanguageLevel configuration.
     */
    public static LanguageLevelOption get( int languageLevel ) {
        return new LanguageLevelOption( languageLevel );
    }

    /**
     * {@inheritDoc}
     */
    public String getPropertyName() {
        return PROPERTY_NAME;
    }

    /**
     * Returns the level of the language to be used
     *
     * @return
     */
    public int getLanguageLevel() {
        return languageLevel;
    }

    @Override
    public String toString() {
        return "LanguageLevelOption( languageLevel="+languageLevel+" )";
    }

    @Override
    public int hashCode() {
        return languageLevel;
    }

    @Override
    public boolean equals(Object obj) {
        if ( this == obj ) return true;
        if ( obj == null ) return false;
        if ( getClass() != obj.getClass() ) return false;
        LanguageLevelOption other = (LanguageLevelOption) obj;
        return languageLevel == other.languageLevel;
    }
}

@@ -91,21 +91,20 @@
 %0Apublic 
-class
+enum
  Languag
@@ -172,57 +172,18 @@
     
-private static final long serialVersionUID = 510l
+DRL5, DRL6
 ;%0A%0A 
@@ -322,1533 +322,107 @@
     
-private final int languageLevel;%0A%0A    /**%0A     * Private constructor to enforce the use of the factory method%0A     * @param languageLevel%0A     */%0A    private LanguageLevelOption( int languageLevel ) %7B%0A        this.languageLevel = languageLevel;%0A    %7D%0A%0A    /**%0A     * This is a factory method for this LanguageLevel configuration.%0A     * The factory method is a best practice for the case where the%0A     * actual object construction is changed in the future.%0A     *%0A     * @param languageLevel the level of the language to be used%0A     *%0A     * @return the actual type safe LanguageLevel configuration.%0A     */%0A    public static LanguageLevelOption get( int languageLevel ) %7B%0A        return new LanguageLevelOption( languageLevel );%0A    %7D%0A%0A    /**%0A     * %7B@inheritDoc%7D%0A     */%0A    public String getPropertyName() %7B%0A        return PROPERTY_NAME;%0A    %7D%0A%0A    /**%0A     * Returns the level of the language to be used%0A     *%0A     * @return%0A     */%0A    public int getLanguageLevel() %7B%0A        return languageLevel;%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return %22LanguageLevelOption( languageLevel=%22+languageLevel+%22 )%22;%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        return languageLevel;%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object obj) %7B%0A        if ( this == obj ) return true;%0A        if ( obj == null ) return false;%0A        if ( getClass() != obj.getClass() ) return false;%0A        LanguageLevelOption other = (LanguageLevelOption) obj;%0A        return languageLevel == other.languageLevel
+/**%0A     * %7B@inheritDoc%7D%0A     */%0A    public String getPropertyName() %7B%0A        return PROPERTY_NAME
 ;%0A  

convert language level option in an enum