| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kew.api.document; |
| 17 | |
|
| 18 | |
import org.kuali.rice.core.api.mo.common.Coded; |
| 19 | |
|
| 20 | |
import javax.xml.bind.annotation.XmlEnum; |
| 21 | |
import javax.xml.bind.annotation.XmlEnumValue; |
| 22 | |
import javax.xml.bind.annotation.XmlRootElement; |
| 23 | |
import javax.xml.bind.annotation.XmlType; |
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | 0 | @XmlRootElement(name = "documentStatusCategory") |
| 32 | |
@XmlType(name = "DocumentStatusCategoryType") |
| 33 | |
@XmlEnum |
| 34 | |
public enum DocumentStatusCategory implements Coded { |
| 35 | |
|
| 36 | 0 | @XmlEnumValue("P") PENDING("P", "Pending"), |
| 37 | 0 | @XmlEnumValue("S") SUCCESSFUL("S", "Successful"), |
| 38 | 0 | @XmlEnumValue("U") UNSUCCESSFUL("U", "Unsuccessful"); |
| 39 | |
|
| 40 | |
private final String code; |
| 41 | |
private final String label; |
| 42 | |
|
| 43 | 0 | private DocumentStatusCategory(String code, String label) { |
| 44 | 0 | this.code = code; |
| 45 | 0 | this.label = label; |
| 46 | 0 | } |
| 47 | |
|
| 48 | |
@Override |
| 49 | |
public String getCode() { |
| 50 | 0 | return code; |
| 51 | |
} |
| 52 | |
|
| 53 | |
public String getLabel() { |
| 54 | 0 | return label; |
| 55 | |
} |
| 56 | |
|
| 57 | |
public static DocumentStatusCategory fromCode(String code) { |
| 58 | 0 | if (code == null) { |
| 59 | 0 | return null; |
| 60 | |
} |
| 61 | 0 | for (DocumentStatusCategory status : values()) { |
| 62 | 0 | if (status.code.equals(code)) { |
| 63 | 0 | return status; |
| 64 | |
} |
| 65 | |
} |
| 66 | 0 | throw new IllegalArgumentException("Failed to locate the DocumentStatusCategory with the given code: " + code); |
| 67 | |
} |
| 68 | |
|
| 69 | |
} |