package com.zm.order.tool.server.enums;

import java.util.Objects;

/**
 * 履约类型
 * @Author chang.n
 * @ClassName PerformanceTypeEnum
 * @Date 2020/4/16 9:53 AM
 */
public enum PerformanceTypeEnum {

    /**
     * 快递
     */
    EXPRESS(1, "快递"),

    /**
     * 同城配送
     */
    DELIVERY(2, "同城配送"),

    /**
     * 自提
     */
    SELF_TAKE(3, "自提");

    private final Integer type;

    private final String desc;

    PerformanceTypeEnum(final Integer type, final String desc){
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static PerformanceTypeEnum getValue(Integer performanceType) {
        for (PerformanceTypeEnum typeEnum : values()) {
            if (Objects.equals(typeEnum.getType(), performanceType)) {
                return typeEnum;
            }
        }
        return null;
    }
}
