-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathServerImpl.java
executable file
·282 lines (233 loc) · 8.71 KB
/
ServerImpl.java
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
package com.reprezen.kaizen.oasparser.ovl3;
import java.util.Map;
import javax.annotation.Generated;
import com.fasterxml.jackson.databind.JsonNode;
import com.reprezen.jsonoverlay.JsonOverlay;
import com.reprezen.jsonoverlay.ObjectOverlay;
import com.reprezen.jsonoverlay.OverlayFactory;
import com.reprezen.jsonoverlay.PropertiesOverlay;
import com.reprezen.jsonoverlay.ReferenceManager;
import com.reprezen.jsonoverlay.StringOverlay;
import com.reprezen.kaizen.oasparser.model3.OpenApi3;
import com.reprezen.kaizen.oasparser.model3.Server;
import com.reprezen.kaizen.oasparser.model3.ServerVariable;
public class ServerImpl extends PropertiesOverlay<Server> implements Server {
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public ServerImpl(JsonNode json, JsonOverlay<?> parent, ReferenceManager refMgr) {
super(json, parent, factory, refMgr);
}
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public ServerImpl(Server server, JsonOverlay<?> parent, ReferenceManager refMgr) {
super(server, parent, factory, refMgr);
}
// Url
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public String getUrl() {
return _get("url", String.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public void setUrl(String url) {
_setScalar("url", url, String.class);
}
// Description
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public String getDescription() {
return _get("description", String.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public void setDescription(String description) {
_setScalar("description", description, String.class);
}
// ServerVariable
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public Map<String, ServerVariable> getServerVariables() {
return _getMap("serverVariables", ServerVariable.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public Map<String, ServerVariable> getServerVariables(boolean elaborate) {
return _getMap("serverVariables", elaborate, ServerVariable.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public boolean hasServerVariables() {
return _isPresent("serverVariables");
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public boolean hasServerVariable(String name) {
return _getMap("serverVariables", ServerVariable.class).containsKey(name);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public ServerVariable getServerVariable(String name) {
return _get("serverVariables", name, ServerVariable.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public void setServerVariables(Map<String, ServerVariable> serverVariables) {
_setMap("serverVariables", serverVariables, ServerVariable.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public void setServerVariable(String name, ServerVariable serverVariable) {
_set("serverVariables", name, serverVariable, ServerVariable.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public void removeServerVariable(String name) {
_remove("serverVariables", name, ServerVariable.class);
}
// VariablesExtension
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public Map<String, Object> getVariablesExtensions() {
return _getMap("variablesExtensions", Object.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public Map<String, Object> getVariablesExtensions(boolean elaborate) {
return _getMap("variablesExtensions", elaborate, Object.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public boolean hasVariablesExtensions() {
return _isPresent("variablesExtensions");
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public boolean hasVariablesExtension(String name) {
return _getMap("variablesExtensions", Object.class).containsKey(name);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public Object getVariablesExtension(String name) {
return _get("variablesExtensions", name, Object.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public void setVariablesExtensions(Map<String, Object> variablesExtensions) {
_setMap("variablesExtensions", variablesExtensions, Object.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public void setVariablesExtension(String name, Object variablesExtension) {
_set("variablesExtensions", name, variablesExtension, Object.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public void removeVariablesExtension(String name) {
_remove("variablesExtensions", name, Object.class);
}
// Extension
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public Map<String, Object> getExtensions() {
return _getMap("extensions", Object.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public Map<String, Object> getExtensions(boolean elaborate) {
return _getMap("extensions", elaborate, Object.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public boolean hasExtensions() {
return _isPresent("extensions");
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public boolean hasExtension(String name) {
return _getMap("extensions", Object.class).containsKey(name);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public Object getExtension(String name) {
return _get("extensions", name, Object.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public void setExtensions(Map<String, Object> extensions) {
_setMap("extensions", extensions, Object.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public void setExtension(String name, Object extension) {
_set("extensions", name, extension, Object.class);
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public void removeExtension(String name) {
_remove("extensions", name, Object.class);
}
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public static final String F_url = "url";
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public static final String F_description = "description";
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public static final String F_serverVariables = "serverVariables";
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public static final String F_variablesExtensions = "variablesExtensions";
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public static final String F_extensions = "extensions";
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
protected void _elaborateJson() {
super._elaborateJson();
_createScalar("url", "url", StringOverlay.factory);
_createScalar("description", "description", StringOverlay.factory);
_createMap("serverVariables", "variables", ServerVariableImpl.factory, "(?!x-)[a-zA-Z0-9\\._-]+");
_createMap("variablesExtensions", "variables", ObjectOverlay.factory, "x-.+");
_createMap("extensions", "", ObjectOverlay.factory, "x-.+");
}
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public static OverlayFactory<Server> factory = new OverlayFactory<Server>() {
@Override
protected Class<? extends JsonOverlay<? super Server>> getOverlayClass() {
return ServerImpl.class;
}
@Override
public JsonOverlay<Server> _create(Server server, JsonOverlay<?> parent, ReferenceManager refMgr) {
JsonOverlay<?> overlay;
overlay = new ServerImpl(server, parent, refMgr);
@SuppressWarnings("unchecked")
JsonOverlay<Server> castOverlay = (JsonOverlay<Server>) overlay;
return castOverlay;
}
@Override
public JsonOverlay<Server> _create(JsonNode json, JsonOverlay<?> parent, ReferenceManager refMgr) {
JsonOverlay<?> overlay;
overlay = new ServerImpl(json, parent, refMgr);
@SuppressWarnings("unchecked")
JsonOverlay<Server> castOverlay = (JsonOverlay<Server>) overlay;
return castOverlay;
}
@Override
protected boolean isExtendedType() {
return false;
}
};
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
private static Class<? extends Server> getSubtypeOf(Server server) {
return Server.class;
}
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
private static Class<? extends Server> getSubtypeOf(JsonNode json) {
return Server.class;
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
public Class<?> _getModelType() {
return OpenApi3.class;
}
@Override
@Generated("com.reprezen.jsonoverlay.gen.CodeGenerator")
protected OverlayFactory<?> _getFactory() {
return factory;
}
}