앱)자바 enum 예제
public enum HistoryMsg {
private final String MN = "MENU";
//Menu management
MENU_ADD(MN, "Menu add"),
MENU_MODIFY(MN,"Menu modified [%s]")
;
public String taskCode;
public String text;
private HistoryMsg(String taskCode, String text){
this.taskCode = taskCode;
this.text = text;
}
}
==================
import HistoryMsg.MENU_MODIFY;
insert(HistoryMsg msg, Object[] args){
Vo.setTaskCode(msg.taskCode);
Vo.setTaskDescription(String.format(msg.text, args));
}
insert(MENU_MODIFY, new String[]{"test"});
private final String MN = "MENU";
//Menu management
MENU_ADD(MN, "Menu add"),
MENU_MODIFY(MN,"Menu modified [%s]")
;
public String taskCode;
public String text;
private HistoryMsg(String taskCode, String text){
this.taskCode = taskCode;
this.text = text;
}
}
==================
import HistoryMsg.MENU_MODIFY;
insert(HistoryMsg msg, Object[] args){
Vo.setTaskCode(msg.taskCode);
Vo.setTaskDescription(String.format(msg.text, args));
}
insert(MENU_MODIFY, new String[]{"test"});
'백엔드개발 > 자바스프링' 카테고리의 다른 글
앱)mybatis config.xml (0) | 2018.11.14 |
---|---|
앱)spring transaction properties mybatis Config설정 예시 샘플 (0) | 2018.11.08 |
앱)자바 멀티스레드 샘플 코드 (0) | 2018.07.09 |
앱)JSP(JavaServer Pages)에 대해서 (0) | 2018.07.03 |
앱)AWS SES Email Util java spring 예제 샘플 (0) | 2018.06.27 |