package com.qmth.file.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 监考端资源包
 * @author tianjun
 *
 */
public enum OpenMonitor {

	YES("是", "1"), NO("否", "0");

    private String name;

    private String id;

    private OpenMonitor(String name, String id) {
        this.name = name;
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public String getId() {
        return id;
    }
    
    public static List<Map<String, String>> toList() {
    	List<Map<String, String>> list = new ArrayList<Map<String, String>>();
    	  for (OpenMonitor theme : OpenMonitor.values()) {
    		  Map<String, String> map = new HashMap<String, String>();
    		  map.put(theme.name(), theme.getName());
          }
		return list;
    }

    public static OpenMonitor findById(String id) {
        for (OpenMonitor status : OpenMonitor.values()) {
            if (status.id == id) {
                return status;
            }
        }
        return null;
    }

}
