1
2 package ca.uhn.fhir.model.dstu.valueset;
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 import java.util.HashMap;
25 import java.util.Map;
26
27 import ca.uhn.fhir.model.api.IValueSetEnumBinder;
28
29 public enum RestfulSecurityServiceEnum {
30
31
32
33
34
35
36 OAUTH("OAuth", "http://hl7.org/fhir/restful-security-service"),
37
38
39
40
41
42
43 OAUTH2("OAuth2", "http://hl7.org/fhir/restful-security-service"),
44
45
46
47
48
49
50 NTLM("NTLM", "http://hl7.org/fhir/restful-security-service"),
51
52
53
54
55
56
57 BASIC("Basic", "http://hl7.org/fhir/restful-security-service"),
58
59
60
61
62
63
64 KERBEROS("Kerberos", "http://hl7.org/fhir/restful-security-service"),
65
66 ;
67
68
69
70
71
72 public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/restful-security-service";
73
74
75
76
77
78 public static final String VALUESET_NAME = "RestfulSecurityService";
79
80 private static Map<String, RestfulSecurityServiceEnum> CODE_TO_ENUM = new HashMap<String, RestfulSecurityServiceEnum>();
81 private static Map<String, Map<String, RestfulSecurityServiceEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, RestfulSecurityServiceEnum>>();
82
83 private final String myCode;
84 private final String mySystem;
85
86 static {
87 for (RestfulSecurityServiceEnum next : RestfulSecurityServiceEnum.values()) {
88 CODE_TO_ENUM.put(next.getCode(), next);
89
90 if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) {
91 SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, RestfulSecurityServiceEnum>());
92 }
93 SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next);
94 }
95 }
96
97
98
99
100 public String getCode() {
101 return myCode;
102 }
103
104
105
106
107 public String getSystem() {
108 return mySystem;
109 }
110
111
112
113
114 public RestfulSecurityServiceEnum forCode(String theCode) {
115 RestfulSecurityServiceEnum retVal = CODE_TO_ENUM.get(theCode);
116 return retVal;
117 }
118
119
120
121
122 public static final IValueSetEnumBinder<RestfulSecurityServiceEnum> VALUESET_BINDER = new IValueSetEnumBinder<RestfulSecurityServiceEnum>() {
123 @Override
124 public String toCodeString(RestfulSecurityServiceEnum theEnum) {
125 return theEnum.getCode();
126 }
127
128 @Override
129 public String toSystemString(RestfulSecurityServiceEnum theEnum) {
130 return theEnum.getSystem();
131 }
132
133 @Override
134 public RestfulSecurityServiceEnum fromCodeString(String theCodeString) {
135 return CODE_TO_ENUM.get(theCodeString);
136 }
137
138 @Override
139 public RestfulSecurityServiceEnum fromCodeString(String theCodeString, String theSystemString) {
140 Map<String, RestfulSecurityServiceEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString);
141 if (map == null) {
142 return null;
143 }
144 return map.get(theCodeString);
145 }
146
147 };
148
149
150
151
152 RestfulSecurityServiceEnum(String theCode, String theSystem) {
153 myCode = theCode;
154 mySystem = theSystem;
155 }
156
157
158 }