
    
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 CriteriaType extends AbstractEnumerated
{
    
    public static final EnumeratedFactory FACTORY_CriteriaType = new CriteriaTypeFactory();
    
    public static final CriteriaType QUALIFICATION = new CriteriaType ("QUALIFICATION", "QUALIFICATION", "Qualifications", false);
    
    public static final CriteriaType SKILL = new CriteriaType ("SKILL", "SKILL", "Skills", false);
    
    public static final CriteriaType EXPERIENCE = new CriteriaType ("EXPERIENCE", "EXPERIENCE", "Experience", false);
    
    public static final CriteriaType KNOWLEDGE = new CriteriaType ("KNOWLEDGE", "KNOWLEDGE", "Knowledge", false);

    private static final CriteriaType[] allCriteriaTypes =
        new CriteriaType[] { QUALIFICATION,SKILL,EXPERIENCE,KNOWLEDGE};


    private static CriteriaType[] getAllCriteriaTypes ()
    {
        return allCriteriaTypes;
    }

    private transient boolean IsSingular;

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

    public boolean getIsSingular()
    {
    return IsSingular;
    }
    
    public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allCriteriaTypes);



    static
    {
        defineAdditionalData ();
    }

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

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


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


    public EnumeratedFactory getFactory ()
    {
        return FACTORY_CriteriaType;
    }

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

        CriteriaType[] all = getAllCriteriaTypes();
        int enumIndex = AbstractEnumerated.getIndexForName (all, name);

        return all[enumIndex];
    }


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

        CriteriaType[] all = getAllCriteriaTypes();
        int enumIndex = AbstractEnumerated.getIndexForValue (getAllCriteriaTypes (), value);

        return all[enumIndex];
    }


    public static java.util.Enumeration getAll ()
    {
        return AbstractEnumerated.getAll (getAllCriteriaTypes());
    }
    
    
    public static CriteriaType[] getCriteriaTypeArray ()
    {
        return (CriteriaType[])getAllCriteriaTypes().clone ();
    }


    public static void defineAdditionalData ()
    {
        QUALIFICATION.IsSingular = false;
        SKILL.IsSingular = false;
        EXPERIENCE.IsSingular = true;
        KNOWLEDGE.IsSingular = true;
        
    }


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

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

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


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

        attribs.put ("IsSingular", ArrayFormatter.toObject(getIsSingular()));
        
        return attribs;
    }
    
    public static class CriteriaTypePipeLineFactory<From, Me extends CriteriaType> extends AbstractEnumerated.EnumPipeLine<From, Me>
    {
        public <Prev> CriteriaTypePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
        {
            super (pipeLine, nextPipe);
        }
        
        public CriteriaTypePipeLineFactory (From seed)
        {
            super(seed);
        }

        public CriteriaTypePipeLineFactory (Collection<From> seed)
        {
            super(seed);
        }
        
        public PipeLine<From, ? extends Object> to(String name)
        {
            if (name.equals ("IsSingular"))
            {
                return toIsSingular ();
            }
            
            return super.to(name);
        }
        
        
        public PipeLine<From, Boolean> toIsSingular () { return pipe(new EnumAttributePipe<Me, Boolean>("IsSingular")); }
    }
}

