package com.unis.crk.enums;

import lombok.Getter;

/**
 * 数据编辑状态
 * @author Administrator
 *
 */
@Getter
public enum EditStatus {
	Unchanged((short)0),			//数据一直未发生变化
	New((short)1),				//新建
	Modified((short)2),			//在上次保存后，数据已发生变化
	Deleted((short)3);			//数据已被删除
	
	// 定义私有变量
    private Short value;
    // 构造函数，枚举类型只能为私有
    private EditStatus(Short value) {
        this.value = value;
    }
    
    @Override
    public String toString() {
        return String.valueOf(this.value);
    }
    
    /**
     * 枚举项的数字值
     * @return 枚举项的数字值
     */
    public Short value(){
    	return this.value;
    }
    
    /**
     * 获取枚举值
     * @param value：枚举项的数字值
     * @return 枚举值
     */
    public static EditStatus valueOf(Short value)
    {
    	switch(value){
        	case 0:
        		return Unchanged;
        	case 1:
        		return New;
        	case 2:
        		return Modified;
        	case 3:
        		return Deleted;
    		default:
    			return null;
        }
    }

    /**
     * 等级枚举类
     * All rights Reserved, Designed By RDA
     * @package ： com.ls.report.util
     * @classname ： LevelUtil
     * @author : wangkexin
     * @date : 2016-11-23
     * @description : TODO(这里用一句话描述这个类的作用)
     *
     */
    public enum LevelUtil {

        FIRST("一等","01"),

        SECOND("二等","02"),

        THIRD("三等","03"),

        FOURTH("四等","04"),

        FIFTH("五等","05"),

        OUT("等外","00");

        private	final	String levelName;

        private	final	String ordinal;

        private LevelUtil(String levelName,String ordinal){
            this.levelName = levelName;
            this.ordinal = ordinal;
        }

        public String getLevel() {
            return this.levelName;
        }

        public	String	getOrdinal() {
            return this.ordinal;
        }

    }
}
