package com.yunfeiyun.agmp.common.enums;

/**
 * 库存变动方式
 * */
public enum ChangeWay {

    IN("I","入库"),
    OUT("O","出库");

    private final String code;
    private final String message;

    ChangeWay(String code, String message)
    {
        this.code = code;
        this.message = message;
    }

    public String getCode()
    {
        return code;
    }

    public String getMessage()
    {
        return message;
    }

    public static String valueOfCode(String code){
        for(ChangeWay stockChangeWay: ChangeWay.values()) {
            if(stockChangeWay.equal(code)){
                return stockChangeWay.getMessage();
            }
        }
        return "";
    }

    public boolean equal(String code){
        return this.code.equals(code);
    }
}
