package com.zd.laboratory.socket.command;

import java.util.Arrays;

public class Symbol {

    public static enum order {
        // 继电器问询
        inquiry("00","继电器问询"),
        // 继电器控制
        control("01","继电器控制"),
        // 定时指令
        timing("02","继电器控制")
        ;

        private String type;

        private String tip;

        order(String s,String tip) {
            this.type = s;
            this.tip = tip;
        }

        public String getType() {
            return type;
        }

        public String getTip() {
            return tip;
        }
    }

    public static enum command {
        open("01","打开"),
        close("00","关闭")
        ;
        private String type;
        private String tip;

        command(String s,String tip) {
            this.type = s;
            this.tip = tip;
        }

        public String getType() {
            return type;
        }

        public String getTip() {
            return tip;
        }
    }
    public static command getByType(String type)
    {
        return Arrays.stream(command.values()).filter(a->a.type.equals(type)).findFirst().orElse(null);

    }
}
