package com.bcxin.risk.report.enums;

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

public enum UserType {

	
	/** 前台*/
	FRONT {public String getValue(){return "1";} public String getName(){return "前台";}}, 
	
	/** 后台*/
	BACKGROUND {public String getValue(){return "2";} public String getName(){return "后台";} }; 
	
    public abstract String getValue();
    
    public abstract String getName();
    
    public static List<UserType> list(){
    	List<UserType> list = new ArrayList<UserType>();
    	list.add(FRONT);
    	list.add(BACKGROUND);
    	return list;
    }
    
    public static UserType convert_value(String value){
    	if("1".equals(value)){
    		return FRONT;
    	} else if("2".equals(value)){
    		return BACKGROUND;
    	}
    	return null;
    }
    
    public static UserType convertName(String name){
    	if("FRONT".equals(name)){
    		return FRONT;
    	} else if("BACKGROUND".equals(name)){
    		return BACKGROUND;
    	}
    	return null;
    }
	
}
