package com.sw.mes.enumvalue;

import lombok.Getter;

public enum MaterialTypeEnumValues {
    主产品物料("主产品物料", "M"), 副产品物料("副产品物料", "D");

    private MaterialTypeEnumValues(String key, String value) {
        this.key = key;
        this.value = value;
    }

    private String key;
    private String value;
    
    
    public String getValueByKey(String key) {
    	for (MaterialTypeEnumValues type : MaterialTypeEnumValues.values()) {
    		if(type.name().equalsIgnoreCase(key)) {
    			return type.getValue();
    		}
		}
    	throw new IllegalArgumentException("Invalid key: "+key);
    }
    
    
	public String getKey() {
		return key;
	}
	public void setKey(String key) {
		this.key = key;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
    
    
}
