enum ContentType{ TEXT(0), //文本 PIC(1), //图片 AUDIO(2), //音频 VIDEO(3), //视频 FILE(11), //文件 USER_INVITATION(15),//好友邀请 AUDIO_FREQUENCY(19),//音频 ; int type;
ContentType(int type) { this.type = type; }
public int getType() { return type; }
public static ContentType convert(int type){ for(ContentType c:ContentType.values()){ if(c.getType() == type){ return c; } } return null; }
}
|