-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathConsentApprovalStatus.java
More file actions
49 lines (38 loc) · 1.29 KB
/
Copy pathConsentApprovalStatus.java
File metadata and controls
49 lines (38 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package org.openhmis.code;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.openhmis.code.serialization.CodeSerializer;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import org.openhmis.code.serialization.CodeLookup;
@JsonSerialize(using = CodeSerializer.class)
@XmlEnum
public enum ConsentApprovalStatus implements BaseCode {
@XmlEnumValue("-1")
ERR_UNKNOWN (-1, "Unknown"),
@XmlEnumValue("pending")
PENDING (0, "pending"),
@XmlEnumValue("approved")
APPROVED (1, "approved"),
@XmlEnumValue("rejected")
REJECTED (2, "rejected");
private final Integer code;
private final String description;
ConsentApprovalStatus(final Integer code, final String description) {
this.code = code;
this.description = description;
}
public Integer getCode() {
return code;
}
public String getDescription() {
return description;
}
// Enable lookups by code
private static final CodeLookup<ConsentApprovalStatus> enhancer = new CodeLookup<ConsentApprovalStatus>(values());
@JsonCreator
public static ConsentApprovalStatus valueByCode(Integer code) {
ConsentApprovalStatus value = enhancer.valueByCode(code);
return (value == null)?ConsentApprovalStatus.ERR_UNKNOWN:value;
}
}