package cn.cecep.talroad.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 操作类型
 */
public enum OperationTypeEnum {

    INSERT_OPERATION(1, "新增"),
    UPDATE_OPERATION(2, "修改"),
    DELETE_OPERATION(3, "删除"),
    CANCEL_THE_CORRESPONDENCE(4, "取消对应关系")
    ;

    private int code;

    private String name;

    OperationTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getName(int code) {
        for (OperationTypeEnum delFlagEnum : OperationTypeEnum.values()) {
            if (delFlagEnum.code == code) {
                return delFlagEnum.name;
            }
        }
        return "--";
    }
}
