
    
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 CouponDuration extends AbstractEnumerated
{
    
    public static final EnumeratedFactory FACTORY_CouponDuration = new CouponDurationFactory();
    
    public static final CouponDuration FOREVER = new CouponDuration ("FOREVER", "FOREVER", "Forever", false);
    
    public static final CouponDuration ONCE = new CouponDuration ("ONCE", "ONCE", "Once", false);
    
    public static final CouponDuration REPEATING = new CouponDuration ("REPEATING", "REPEATING", "Repeating", false);

    private static final CouponDuration[] allCouponDurations =
        new CouponDuration[] { FOREVER,ONCE,REPEATING};


    private static CouponDuration[] getAllCouponDurations ()
    {
        return allCouponDurations;
    }

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



    static
    {
        defineAdditionalData ();
    }

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

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


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


    public EnumeratedFactory getFactory ()
    {
        return FACTORY_CouponDuration;
    }

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

        CouponDuration[] all = getAllCouponDurations();
        int enumIndex = AbstractEnumerated.getIndexForName (all, name);

        return all[enumIndex];
    }


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

        CouponDuration[] all = getAllCouponDurations();
        int enumIndex = AbstractEnumerated.getIndexForValue (getAllCouponDurations (), value);

        return all[enumIndex];
    }


    public static java.util.Enumeration getAll ()
    {
        return AbstractEnumerated.getAll (getAllCouponDurations());
    }
    
    
    public static CouponDuration[] getCouponDurationArray ()
    {
        return (CouponDuration[])getAllCouponDurations().clone ();
    }


    public static void defineAdditionalData ()
    {
        
    }


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

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

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


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

        
        return attribs;
    }
}

