/********************************************************************
 * Copyright © 2004 VHA. All rights reserved
 ********************************************************************/
package gov.va.med.esr.common.model.lookup;

//Framework Classes
import java.util.Date;

import gov.va.med.fw.model.lookup.AbstractCode;
import gov.va.med.fw.model.lookup.AbstractNamedActiveLookup;

//Java Classes

//Library Classes

/**
 * @author Commons Team
 * @version 1.0
 */
public class EnrollmentPriorityGroup extends AbstractNamedActiveLookup implements Comparable<EnrollmentPriorityGroup>  {
	
    /**
	 * An instance of serialVersionUID
	 */
	private static final long serialVersionUID = -4504587384519124961L;
	public static final Code GROUP_1 = new Code("1");
    public static final Code GROUP_2 = new Code("2");
    public static final Code GROUP_3 = new Code("3");
    public static final Code GROUP_4 = new Code("4");
    public static final Code GROUP_5 = new Code("5");
    public static final Code GROUP_6 = new Code("6");
    public static final Code GROUP_7 = new Code("7");
    public static final Code GROUP_8 = new Code("8");

    public static class Code extends AbstractCode {
        /**
		 * An instance of serialVersionUID
		 */
		private static final long serialVersionUID = -1242108260406386119L;

		private Code(String code) {
            super(code);
        }

        public static Code getByCode(String code) {
            return (Code) getCode(Code.class, code);
        }
        
        public int compareTo(Object obj) {
        	if ( obj != null && obj instanceof Code ) {
        		String otherCode = ((Code)obj).getCode();
        		return getCode().compareTo(otherCode);
        	}
        	return 1;
        }
    }

    /**
     * Default constructor.
     */
    public EnrollmentPriorityGroup() {
        super();
    }
    
    public int compareTo(EnrollmentPriorityGroup other) {
        if (other != null)
            return getCode().compareTo(other.getCode());
        else
            return 1;
    }
}