Resolved conflict

This commit is contained in:
rajesh
2025-09-30 20:24:55 +05:30
parent 53500decd7
commit 193283e99a
27 changed files with 523 additions and 77 deletions

View File

@@ -161,19 +161,22 @@ public class Utils {
}
public static <T> List<T> convertJsonStringToList(String jsonString, Class<T> clazz) {
try {
TypeReference<List<T>> typeRef = new TypeReference<List<T>>() {
@Override
public Type getType() {
return TypeFactory.defaultInstance().constructCollectionType(List.class, clazz);
}
};
return mapper.readValue(jsonString, typeRef);
} catch (Exception e) {
e.printStackTrace();
// Handle the exception appropriately (e.g., throw a custom exception)
return null;
if(jsonString!=null) {
try {
TypeReference<List<T>> typeRef = new TypeReference<List<T>>() {
@Override
public Type getType() {
return TypeFactory.defaultInstance().constructCollectionType(List.class, clazz);
}
};
return mapper.readValue(jsonString, typeRef);
} catch (Exception e) {
e.printStackTrace();
// Handle the exception appropriately (e.g., throw a custom exception)
return null;
}
}
return null;
}
public static String convertMapIntoJsonString(Map<String, Object> map) {