package com.qnfhq.modules.c2c.enums;


public enum DirectionEnum {

    SELL(2,"卖出"),
    BUY(1,"买入");

    private Integer code;

    private String desc;

    public Integer getCode()
    {
        return code;
    }

    public String getDesc()
    {
        return desc;
    }

    DirectionEnum(Integer code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public static boolean isValidCode(Integer code) {
        for (DirectionEnum directionEnum : DirectionEnum.values()) {
            if (directionEnum.getCode().intValue() == code.intValue()) {
                return true;
            }
        }
        return false;
    }
}
