JAVA枚舉及其用法
/**
* 狀態
*/
public enum ContentStatus
{
/**
* 所有
*/
all,
/**
* 草稿
*/
draft,
/**
* 待審覈
*/
prepared,
/**
* 已審
*/
passed,
/**
* 終審
*/
checked,
/**
* 退回
*/
rejected,
/**
* 回收
*/
recycle,
/**
* 投稿
*/
contribute
};
ContentStatus status ;
if (!StringUtils. isBlank(queryStatus))
{
status = ContentStatus.valueOf(queryStatus);
} else {
status = ContentStatus.all;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.