1 | |
package org.kuali.student.lum.program.client; |
2 | |
|
3 | |
import org.kuali.student.lum.program.client.properties.ProgramProperties; |
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | 0 | public enum ProgramStatus { |
9 | 0 | SUPERSEDED(ProgramProperties.get().status_superseded(),null), |
10 | 0 | ACTIVE(ProgramProperties.get().status_active(), SUPERSEDED), |
11 | 0 | APPROVED(ProgramProperties.get().status_approved(), ACTIVE), |
12 | 0 | DRAFT(ProgramProperties.get().status_draft(), APPROVED); |
13 | |
|
14 | |
private final String value; |
15 | |
|
16 | |
private final ProgramStatus nextStatus; |
17 | |
|
18 | 0 | ProgramStatus(String value, ProgramStatus nextStatus) { |
19 | 0 | this.value = value; |
20 | 0 | this.nextStatus = nextStatus; |
21 | 0 | } |
22 | |
|
23 | |
public String getValue() { |
24 | 0 | return value; |
25 | |
} |
26 | |
|
27 | |
public ProgramStatus getNextStatus() { |
28 | 0 | return nextStatus; |
29 | |
} |
30 | |
|
31 | |
public static ProgramStatus of(String value) { |
32 | 0 | for (ProgramStatus status : values()) { |
33 | 0 | if (status.getValue().equalsIgnoreCase(value)) { |
34 | 0 | return status; |
35 | |
} |
36 | |
} |
37 | 0 | return null; |
38 | |
} |
39 | |
} |