@@ -81,45 +81,48 @@ public IncidentResponseIncludedItem deserialize(JsonParser jp, DeserializationCo
8181 boolean typeCoercion = ctxt .isEnabled (MapperFeature .ALLOW_COERCION_OF_SCALARS );
8282 int match = 0 ;
8383 JsonToken token = tree .traverse (jp .getCodec ()).nextToken ();
84- // deserialize User
84+ // deserialize IncidentUserData
8585 try {
8686 boolean attemptParsing = true ;
8787 // ensure that we respect type coercion as set on the client ObjectMapper
88- if (User .class .equals (Integer .class )
89- || User .class .equals (Long .class )
90- || User .class .equals (Float .class )
91- || User .class .equals (Double .class )
92- || User .class .equals (Boolean .class )
93- || User .class .equals (String .class )) {
88+ if (IncidentUserData .class .equals (Integer .class )
89+ || IncidentUserData .class .equals (Long .class )
90+ || IncidentUserData .class .equals (Float .class )
91+ || IncidentUserData .class .equals (Double .class )
92+ || IncidentUserData .class .equals (Boolean .class )
93+ || IncidentUserData .class .equals (String .class )) {
9494 attemptParsing = typeCoercion ;
9595 if (!attemptParsing ) {
9696 attemptParsing |=
97- ((User .class .equals (Integer .class ) || User .class .equals (Long .class ))
97+ ((IncidentUserData .class .equals (Integer .class )
98+ || IncidentUserData .class .equals (Long .class ))
9899 && token == JsonToken .VALUE_NUMBER_INT );
99100 attemptParsing |=
100- ((User .class .equals (Float .class ) || User .class .equals (Double .class ))
101+ ((IncidentUserData .class .equals (Float .class )
102+ || IncidentUserData .class .equals (Double .class ))
101103 && (token == JsonToken .VALUE_NUMBER_FLOAT
102104 || token == JsonToken .VALUE_NUMBER_INT ));
103105 attemptParsing |=
104- (User .class .equals (Boolean .class )
106+ (IncidentUserData .class .equals (Boolean .class )
105107 && (token == JsonToken .VALUE_FALSE || token == JsonToken .VALUE_TRUE ));
106- attemptParsing |= (User .class .equals (String .class ) && token == JsonToken .VALUE_STRING );
108+ attemptParsing |=
109+ (IncidentUserData .class .equals (String .class ) && token == JsonToken .VALUE_STRING );
107110 }
108111 }
109112 if (attemptParsing ) {
110- tmp = tree .traverse (jp .getCodec ()).readValueAs (User .class );
113+ tmp = tree .traverse (jp .getCodec ()).readValueAs (IncidentUserData .class );
111114 // TODO: there is no validation against JSON schema constraints
112115 // (min, max, enum, pattern...), this does not perform a strict JSON
113116 // validation, which means the 'match' count may be higher than it should be.
114- if (!((User ) tmp ).unparsed ) {
117+ if (!((IncidentUserData ) tmp ).unparsed ) {
115118 deserialized = tmp ;
116119 match ++;
117120 }
118- log .log (Level .FINER , "Input data matches schema 'User '" );
121+ log .log (Level .FINER , "Input data matches schema 'IncidentUserData '" );
119122 }
120123 } catch (Exception e ) {
121124 // deserialization failed, continue
122- log .log (Level .FINER , "Input data does not match schema 'User '" , e );
125+ log .log (Level .FINER , "Input data does not match schema 'IncidentUserData '" , e );
123126 }
124127
125128 // deserialize IncidentAttachmentData
@@ -197,7 +200,7 @@ public IncidentResponseIncludedItem() {
197200 super ("oneOf" , Boolean .FALSE );
198201 }
199202
200- public IncidentResponseIncludedItem (User o ) {
203+ public IncidentResponseIncludedItem (IncidentUserData o ) {
201204 super ("oneOf" , Boolean .FALSE );
202205 setActualInstance (o );
203206 }
@@ -208,7 +211,7 @@ public IncidentResponseIncludedItem(IncidentAttachmentData o) {
208211 }
209212
210213 static {
211- schemas .put ("User " , new GenericType <User >() {});
214+ schemas .put ("IncidentUserData " , new GenericType <IncidentUserData >() {});
212215 schemas .put ("IncidentAttachmentData" , new GenericType <IncidentAttachmentData >() {});
213216 JSON .registerDescendants (
214217 IncidentResponseIncludedItem .class , Collections .unmodifiableMap (schemas ));
@@ -221,14 +224,14 @@ public Map<String, GenericType> getSchemas() {
221224
222225 /**
223226 * Set the instance that matches the oneOf child schema, check the instance parameter is valid
224- * against the oneOf child schemas: User , IncidentAttachmentData
227+ * against the oneOf child schemas: IncidentUserData , IncidentAttachmentData
225228 *
226229 * <p>It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a
227230 * composed schema (allOf, anyOf, oneOf).
228231 */
229232 @ Override
230233 public void setActualInstance (Object instance ) {
231- if (JSON .isInstanceOf (User .class , instance , new HashSet <Class <?>>())) {
234+ if (JSON .isInstanceOf (IncidentUserData .class , instance , new HashSet <Class <?>>())) {
232235 super .setActualInstance (instance );
233236 return ;
234237 }
@@ -241,28 +244,29 @@ public void setActualInstance(Object instance) {
241244 super .setActualInstance (instance );
242245 return ;
243246 }
244- throw new RuntimeException ("Invalid instance type. Must be User, IncidentAttachmentData" );
247+ throw new RuntimeException (
248+ "Invalid instance type. Must be IncidentUserData, IncidentAttachmentData" );
245249 }
246250
247251 /**
248- * Get the actual instance, which can be the following: User , IncidentAttachmentData
252+ * Get the actual instance, which can be the following: IncidentUserData , IncidentAttachmentData
249253 *
250- * @return The actual instance (User , IncidentAttachmentData)
254+ * @return The actual instance (IncidentUserData , IncidentAttachmentData)
251255 */
252256 @ Override
253257 public Object getActualInstance () {
254258 return super .getActualInstance ();
255259 }
256260
257261 /**
258- * Get the actual instance of `User `. If the actual instance is not `User`, the ClassCastException
259- * will be thrown.
262+ * Get the actual instance of `IncidentUserData `. If the actual instance is not
263+ * `IncidentUserData`, the ClassCastException will be thrown.
260264 *
261- * @return The actual instance of `User `
262- * @throws ClassCastException if the instance is not `User `
265+ * @return The actual instance of `IncidentUserData `
266+ * @throws ClassCastException if the instance is not `IncidentUserData `
263267 */
264- public User getUser () throws ClassCastException {
265- return (User ) super .getActualInstance ();
268+ public IncidentUserData getIncidentUserData () throws ClassCastException {
269+ return (IncidentUserData ) super .getActualInstance ();
266270 }
267271
268272 /**
0 commit comments