package com.jiuqi.mobile.nigo.comeclose.bean.cross; public enum LBSMode { BaiDu(1), GaoDe(2), GPS(3), JIz(4); private int code; private LBSMode(int code){ this.code = code; } public int getCode() { return code; } public static LBSMode getLbsMode(int code){ for(LBSMode lbs : LBSMode.values()){ if(lbs.getCode() == code){ return lbs; } } return null; } public static String getName(LBSMode l){ if(l==LBSMode.GaoDe){ return "高德定位"; }else if(l==LBSMode.BaiDu){ return "百度定位"; }else if(l==LBSMode.GPS){ return "GPS定位"; }else{ return "基站"; } } }