
    
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 UsageType extends AbstractEnumerated
{
    
    public static final EnumeratedFactory FACTORY_UsageType = new UsageTypeFactory();
    
    public static final UsageType METERED = new UsageType ("METERED", "METERED", "Metered", false);
    
    public static final UsageType LICENSED = new UsageType ("LICENSED", "LICENSED", "Licensed", false);

    private static final UsageType[] allUsageTypes =
        new UsageType[] { METERED,LICENSED};


    private static UsageType[] getAllUsageTypes ()
    {
        return allUsageTypes;
    }

    private UsageType (String name, String value, String description, boolean disabled)
    {
        super (name, value, description, disabled);
    }
    
    public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allUsageTypes);



    static
    {
        defineAdditionalData ();
    }

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

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


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


    public EnumeratedFactory getFactory ()
    {
        return FACTORY_UsageType;
    }

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

        UsageType[] all = getAllUsageTypes();
        int enumIndex = AbstractEnumerated.getIndexForName (all, name);

        return all[enumIndex];
    }


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

        UsageType[] all = getAllUsageTypes();
        int enumIndex = AbstractEnumerated.getIndexForValue (getAllUsageTypes (), value);

        return all[enumIndex];
    }


    public static java.util.Enumeration getAll ()
    {
        return AbstractEnumerated.getAll (getAllUsageTypes());
    }
    
    
    public static UsageType[] getUsageTypeArray ()
    {
        return (UsageType[])getAllUsageTypes().clone ();
    }


    public static void defineAdditionalData ()
    {
        
    }


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

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

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


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

        
        return attribs;
    }
}

