
    
package performa.orm.types;

import java.util.*;
import oneit.utils.*;



/**
 * This class was generated using constGen.bat.
 * DO NOT MODIFY THIS CODE.
 * Edit the associated .xml file, and regenerate this file
 * constGen (directory) (file minus extension)
 * e.g. constGen C:\...\sql FieldType
 */

public class Importance extends AbstractEnumerated
{
    
    public static final EnumeratedFactory FACTORY_Importance = new ImportanceFactory();
    
    public static final Importance NOT_APPLICABLE = new Importance ("NOT_APPLICABLE", "NOT_APPLICABLE", "Not Applicable", false);
    
    public static final Importance DESIRABLE = new Importance ("DESIRABLE", "DESIRABLE", "Desirable", false);
    
    public static final Importance HIGHLY_DESIRABLE = new Importance ("HIGHLY_DESIRABLE", "HIGHLY_DESIRABLE", "Highly Desirable", false);
    
    public static final Importance ESSENTIAL = new Importance ("ESSENTIAL", "ESSENTIAL", "Essential", false);

    private static final Importance[] allImportances =
        new Importance[] { NOT_APPLICABLE,DESIRABLE,HIGHLY_DESIRABLE,ESSENTIAL};


    private static Importance[] getAllImportances ()
    {
        return allImportances;
    }

    private transient boolean ConsiderForAssessment;

    private transient Integer WeightingScore;

    private Importance (String name, String value, String description, boolean disabled)
    {
        super (name, value, description, disabled);
    }

    public boolean getConsiderForAssessment()
    {
    return ConsiderForAssessment;
    }

    public Integer getWeightingScore()
    {
    return WeightingScore;
    }
    
    public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allImportances);



    static
    {
        defineAdditionalData ();
    }

    public boolean isEqual (Importance other)
    {
    return this.name.equals (other.name);
    }

    public Enumeration getAllInstances ()
    {
        return Importance.getAll ();
    }


    private Object readResolve() throws java.io.ObjectStreamException
    {
        return Importance.forName (this.name);
    }


    public EnumeratedFactory getFactory ()
    {
        return FACTORY_Importance;
    }

    public static Importance forName (String name)
    {
        if (name == null) { return null; }

        Importance[] all = getAllImportances();
        int enumIndex = AbstractEnumerated.getIndexForName (all, name);

        return all[enumIndex];
    }


    public static Importance forValue (String value)
    {
        if (value == null) { return null; }

        Importance[] all = getAllImportances();
        int enumIndex = AbstractEnumerated.getIndexForValue (getAllImportances (), value);

        return all[enumIndex];
    }


    public static java.util.Enumeration getAll ()
    {
        return AbstractEnumerated.getAll (getAllImportances());
    }
    
    
    public static Importance[] getImportanceArray ()
    {
        return (Importance[])getAllImportances().clone ();
    }


    public static void defineAdditionalData ()
    {
        NOT_APPLICABLE.ConsiderForAssessment = false;
        NOT_APPLICABLE.WeightingScore = 0;
        DESIRABLE.ConsiderForAssessment = true;
        DESIRABLE.WeightingScore = 2;
        HIGHLY_DESIRABLE.ConsiderForAssessment = true;
        HIGHLY_DESIRABLE.WeightingScore = 5;
        ESSENTIAL.ConsiderForAssessment = true;
        ESSENTIAL.WeightingScore = 10;
        
    }


    static class ImportanceFactory implements EnumeratedFactory
    {
        public AbstractEnumerated getForName (String name)
        {
            return Importance.forName (name);
        }

        public AbstractEnumerated getForValue (String name)
        {
            return Importance.forValue (name);
        }

        public Enumeration getAll ()
        {
            return Importance.getAll ();
        }
    }


    public Map getAdditionalAttributes ()
    {
        Map attribs = new HashMap ();

        attribs.put ("ConsiderForAssessment", ArrayFormatter.toObject(getConsiderForAssessment()));
        attribs.put ("WeightingScore", ArrayFormatter.toObject(getWeightingScore()));
        
        return attribs;
    }
}

