@@ -359,8 +359,36 @@ protected Class<?> _findPrimitive(String className)
359
359
* Can be used, for example, to get equivalent of "HashMap<String,Integer>"
360
360
* from "Map<String,Integer>" by giving <code>HashMap.class</code>
361
361
* as subclass.
362
+ * Short-cut for:
363
+ *<pre>
364
+ * constructSpecializedType(baseType, subclass, class);
365
+ *</pre>
366
+ * that is, will use "strict" compatibility checking, usually used for
367
+ * deserialization purposes (but often not for serialization).
368
+ */
369
+ public JavaType constructSpecializedType (JavaType baseType , Class <?> subclass ) {
370
+ return constructSpecializedType (baseType , subclass , false );
371
+ }
372
+
373
+ /**
374
+ * Factory method for creating a subtype of given base type, as defined
375
+ * by specified subclass; but retaining generic type information if any.
376
+ * Can be used, for example, to get equivalent of "HashMap<String,Integer>"
377
+ * from "Map<String,Integer>" by giving <code>HashMap.class</code>
378
+ * as subclass.
379
+ *
380
+ * @param baseType Declared base type with resolved type parameters
381
+ * @param subclass Runtime subtype to use for resolving
382
+ * @param relaxedCompatibilityCheck Whether checking for type-assignment compatibility
383
+ * should be "relaxed" ({@code true}) or "strict" ({@code false}): typically
384
+ * serialization uses relaxed, deserialization strict checking.
385
+ *
386
+ * @return Resolved sub-type
387
+ *
388
+ * @since 2.11
362
389
*/
363
- public JavaType constructSpecializedType (JavaType baseType , Class <?> subclass )
390
+ public JavaType constructSpecializedType (JavaType baseType , Class <?> subclass ,
391
+ boolean relaxedCompatibilityCheck )
364
392
{
365
393
// simple optimization to avoid costly introspection if type-erased type does NOT differ
366
394
final Class <?> rawBase = baseType .getRawClass ();
0 commit comments