所有String to Enum
转换示例只采用一个字符串,但在我的示例字符串中,像这样......
String allDays="MONDAY,SUNDAY,FRIDAY";
和我的枚举类这样..
public 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 int getDay() {
return day;
}
}
所以在那段时间WeedayType.valueOf(allDay)
给出了错误.....对此有任何建议..