package com.freemud.sdk.api.assortment.order.enums;

/**
 * All rights Reserved, Designed By www.freemud.cn
 *
 * @version V1.0
 * @Title: AutoOrderConfigTime
 * @Package com.freemud.sdk.api.assortment.order.enums
 * @Description:
 * @author: jiaxin.liu
 * @date: 2019/6/17 16:19
 * @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
 * 注意：本内容仅限于上海非码科技内部传阅，禁止外泄以及用于其他的商业目
 */
public enum AutoOrderConfigTime {
    two_hours("1",120),
    one_hour("2",60),
    half_hour("3",30),
    fifteen_minutes("4",15),
    ten_minutes("5",10),
    five_minutes("6",5),
    three_minutes("7",3),
    two_minutes("8",2)
    ;
    private String type;
    private Integer time;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getTime() {
        return time;
    }

    public void setTime(Integer time) {
        this.time = time;
    }

    AutoOrderConfigTime(String type, Integer time){
        this.type = type;
        this.time = time;
    }

    public static Integer getTime(String type){
        for (AutoOrderConfigTime autoOrderConfigTime:values()){
            if (autoOrderConfigTime.getType().equals(type)){
                return autoOrderConfigTime.getTime();
            }
        }
        return null;
    }
}
