package com.usky.rule.enums;

public enum TriggerTypeEnum {
    CRON("cron"),
    SPACE("space"),
    DEVICE("device");

    private final String type;

    private TriggerTypeEnum(String type) {
        this.type = type;
    }

    public static TriggerTypeEnum getTypeEnum(String type) {
        for(TriggerTypeEnum typeEnum : values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }

        return null;
    }

    public String getType() {
        return this.type;
    }
}
