Resolved conflict
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user