Resolved Conflicts.

This commit is contained in:
piyushkag
2024-12-24 18:46:28 +05:30
60 changed files with 1181 additions and 252 deletions

View File

@@ -664,7 +664,29 @@ public class Utils {
}
return null;
}
// Method to convert a JSON string to an object of type T
public static <T> T convertStringToObject(String jsonString, Class<T> clazz) {
try {
return mapper.readValue(jsonString, clazz);
} catch (Exception e) {
e.printStackTrace();
// Handle the exception appropriately (e.g., throw a custom exception)
return null;
}
}
// Method to convert an object of type T to a JSON string
public static <T> String convertObjectToString(T object) {
try {
return mapper.writeValueAsString(object);
} catch (Exception e) {
e.printStackTrace();
// Handle the exception appropriately (e.g., throw a custom exception)
return null;
}
}
public static String createChannelForUserAndCompany(Long userId, Long companyId) {
return GepafinConstant.COMMON_SINGLE_CHANNEL_PREFIX + userId + GepafinConstant.COMPANY_PREFIX + companyId;
}