1 | |
package org.kuali.student.enrollment.courseoffering.dto; |
2 | |
|
3 | |
import javax.xml.bind.annotation.XmlEnum; |
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | 0 | @XmlEnum(String.class) |
13 | |
public enum FinalExam { |
14 | |
|
15 | 0 | STANDARD("STANDARD"), ALTERNATE("ALTERNATE"), NONE("NONE"); |
16 | |
|
17 | |
private final String name; |
18 | |
|
19 | 0 | FinalExam(String name) { |
20 | 0 | this.name = name; |
21 | 0 | } |
22 | |
|
23 | |
public static FinalExam toEnum(String value) { |
24 | 0 | if (value != null) { |
25 | 0 | for (FinalExam finalExam : values()) { |
26 | 0 | if (finalExam.name.equals(value)) { |
27 | 0 | return finalExam; |
28 | |
} |
29 | |
} |
30 | |
} |
31 | 0 | return FinalExam.NONE; |
32 | |
} |
33 | |
|
34 | |
public String fromEnum() { |
35 | 0 | return name; |
36 | |
} |
37 | |
} |