package cn.com.qmth.stmms.common.enums;

import java.util.LinkedList;
import java.util.List;

public enum TagType {

    BREACH("违纪", 0);

    private String name;

    private int value;

    private static List<TagType> list;

    private TagType(String name, int value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

    public static TagType findByValue(int value) {
        TagType status = null;
        for (TagType s : TagType.values()) {
            if (s.getValue() == value) {
                status = s;
                break;
            }
        }
        return status;
    }

    public static List<TagType> getTypeList() {
        if (list == null) {
            list = new LinkedList<TagType>();
            for (TagType type : TagType.values()) {
                list.add(type);
            }
        }
        return list;
    }
}
