package com.platform.modules.live.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by TROY on 2019/2/16.
 */
public enum ReportTypeEnum {
	/**
	 * 视频
	 */
	VIDEO("视频", 1),
	/**
	 * 音频
	 */
	AUDIO("音频", 2),
	/**
	 * 图文
	 */
	PICTURE("图文", 3),
	/**
	 * 文字
	 */
	TEXT("文字", 4);

	private String type;
	private Integer key;

	ReportTypeEnum(String type, Integer key) {
		this.type = type;
		this.key = key;
	}

	public static String getName(Integer key) {
		for (ReportTypeEnum type : ReportTypeEnum.values()) {
			if(type.getKey().equals(key)) {
				return type.getType();
			}
		}
		return  null;
	}

	public static List<Integer> getKeys() {
		List<Integer> list = new ArrayList<>();
		for (ReportTypeEnum type : ReportTypeEnum.values()) {
			list.add(type.getKey());
		}
		return list;
	}

	public String getType() {
		return type;
	}

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

	public Integer getKey() {
		return key;
	}

	public void setKey(Integer key) {
		this.key = key;
	}
}
