実際、私のJavaプログラムは...
public class Schedule {
public static enum RepeatType {
DAILY, WEEKLY, MONTHLY;
}
public static enum WeekdayType {
MONDAY(Calendar.MONDAY), TUESDAY(Calendar.TUESDAY),
WEDNESDAY(Calendar.WEDNESDAY), THURSDAY(Calendar.THURSDAY),
FRIDAY(Calendar.FRIDAY), SATURDAY(Calendar.SATURDAY), SUNDAY(Calendar.SUNDAY);
private int day;
private WeekdayType(int day) {
this.day = day;
}
public static List<Date> generateSchedule(RepeatType repeatType,List<WeekdayType> repeatDays) {
// ...
// here some logic i wrote
}
}
}
そして、私は次のようにビジネスクラスにメソッドを呼び出しています...
@RemotingInclude
public void createEvent(TimetableVO timetableVO) {
if ("repeatDays".equals(timetableVO.getSearchKey())) {
List<Date> repeatDaysList = Schedule.generateSchedule(timetableVO.getRepeatType() , timetableVO.getRepeatDays());
}
}
そして最後TimetableVO
に
@Entity
@Table(name="EC_TIMETABLE")
public class TimetableVO extends AbstractVO {
// ...
private RepeatType repeatType;
// But in this case the method generateSchedule(-,-) was not calling.
private List<WeekdayType> repeatDays;
// ...
}
だから私の質問は、次の中でどちらがより良いステートメントであるかです...
private List<WeekdayType> repeatDays;
(また)
// If we give like this `How to Convert Enum type to String` because generateSchedule() method taking enum type value....
private String repeatDays;