-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: POJO
Validate Map types to ensure when writing to the Pojo or to MongoDB they are of type Map<String, ?>. Check any concrete Map implementations eg:
Type[] genericInterfaces = Document.class.getGenericInterfaces(); for (var type : genericInterfaces) { if (type instanceof ParameterizedType parameterizedType) { System.out.println(parameterizedType.getRawType().getTypeName()); for (var typeArguments : parameterizedType.getActualTypeArguments()) { System.out.println(" " + typeArguments.getTypeName()); } } } prints: java.util.Map java.lang.String java.lang.Object