package com.sw.mes.enumvalue;

import com.sw.mes.core.enums.EnumValue;
import lombok.Getter;

/**
 * @author Administrator
 */
public class SurplusStepEnum {

    /**
     * 余料信号类型
     */
    @Getter
    public enum StepNameEnum implements EnumValue.KeyValueInt {

        埚底焖炉(0, "埚底焖炉"),
        埚底(1, "埚底"),
        焖炉(2, "焖炉"),
        提肩(3, "提肩");

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

        public static String getText(int value) {
            StepNameEnum[] businessModeEnums = values();
            for (StepNameEnum businessModeEnum : businessModeEnums) {
                if (businessModeEnum.getKey() == value) {
                    return businessModeEnum.getValue();
                }
            }
            return null;
        }

        public static StepNameEnum getEnum(String value) {
            StepNameEnum[] enums = values();
            for (StepNameEnum enumz : enums) {
                if (String.valueOf(enumz.getKey()).equals(value)) {
                    return enumz;
                }
            }
            return null;
        }

        private int key;
        private String value;
    }
}
