
    
package performa.orm.types;

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



/**
 * 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 AssessmentType extends AbstractEnumerated
{
    
    public static final EnumeratedFactory FACTORY_AssessmentType = new AssessmentTypeFactory();
    
    public static final AssessmentType COMPREHENSIVE = new AssessmentType ("COMPREHENSIVE", "COMPREHENSIVE", "Matchd Comprehensive", false);
    
    public static final AssessmentType EXPRESS = new AssessmentType ("EXPRESS", "EXPRESS", "Matchd Express", false);

    private static final AssessmentType[] allAssessmentTypes =
        new AssessmentType[] { COMPREHENSIVE,EXPRESS};


    private static AssessmentType[] getAllAssessmentTypes ()
    {
        return allAssessmentTypes;
    }

    private transient Integer TotalTime;

    private transient String QuestionDetails;

    private transient String TestDescr;

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

    public Integer getTotalTime()
    {
    return TotalTime;
    }

    public String getQuestionDetails()
    {
    return QuestionDetails;
    }

    public String getTestDescr()
    {
    return TestDescr;
    }
    
    public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allAssessmentTypes);



    static
    {
        defineAdditionalData ();
    }

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

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


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


    public EnumeratedFactory getFactory ()
    {
        return FACTORY_AssessmentType;
    }

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

        AssessmentType[] all = getAllAssessmentTypes();
        int enumIndex = AbstractEnumerated.getIndexForName (all, name);

        return all[enumIndex];
    }


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

        AssessmentType[] all = getAllAssessmentTypes();
        int enumIndex = AbstractEnumerated.getIndexForValue (getAllAssessmentTypes (), value);

        return all[enumIndex];
    }


    public static java.util.Enumeration getAll ()
    {
        return AbstractEnumerated.getAll (getAllAssessmentTypes());
    }
    
    
    public static AssessmentType[] getAssessmentTypeArray ()
    {
        return (AssessmentType[])getAllAssessmentTypes().clone ();
    }


    public static void defineAdditionalData ()
    {
        COMPREHENSIVE.TotalTime = 20;
        COMPREHENSIVE.QuestionDetails = " (250 Questions - 20 Minutes)";
        COMPREHENSIVE.TestDescr = "Comprehensive Assessment";
        EXPRESS.TotalTime = 5;
        EXPRESS.QuestionDetails = " (48 Questions - 5 Minutes)";
        EXPRESS.TestDescr = "Express Assessment";
        
    }


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

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

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


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

        attribs.put ("TotalTime", ArrayFormatter.toObject(getTotalTime()));
        attribs.put ("QuestionDetails", ArrayFormatter.toObject(getQuestionDetails()));
        attribs.put ("TestDescr", ArrayFormatter.toObject(getTestDescr()));
        
        return attribs;
    }
    
    public static class AssessmentTypePipeLineFactory<From, Me extends AssessmentType> extends AbstractEnumerated.EnumPipeLine<From, Me>
    {
        public <Prev> AssessmentTypePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
        {
            super (pipeLine, nextPipe);
        }
        
        public AssessmentTypePipeLineFactory (From seed)
        {
            super(seed);
        }

        public AssessmentTypePipeLineFactory (Collection<From> seed)
        {
            super(seed);
        }
        
        public PipeLine<From, ? extends Object> to(String name)
        {
            if (name.equals ("TotalTime"))
            {
                return toTotalTime ();
            }
            if (name.equals ("QuestionDetails"))
            {
                return toQuestionDetails ();
            }
            if (name.equals ("TestDescr"))
            {
                return toTestDescr ();
            }
            
            return super.to(name);
        }
        
        
        public PipeLine<From, Integer> toTotalTime () { return pipe(new EnumAttributePipe<Me, Integer>("TotalTime")); }
        
        public PipeLine<From, String> toQuestionDetails () { return pipe(new EnumAttributePipe<Me, String>("QuestionDetails")); }
        
        public PipeLine<From, String> toTestDescr () { return pipe(new EnumAttributePipe<Me, String>("TestDescr")); }
    }
}

