aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-dao/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-dao/src/main')
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/DaoUtils.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/DaoUtils.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/DaoUtils.java
index b21d1e9630..35941dea89 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/DaoUtils.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/DaoUtils.java
@@ -29,7 +29,11 @@ import com.google.gson.Gson;
* Utility class for convertation to/from JSON string
*/
public class DaoUtils {
-
+
+ private DaoUtils() {
+
+ }
+
/**
* Convert from Object to Json string
*
@@ -52,6 +56,10 @@ public class DaoUtils {
* @return object
*/
public static <T> T convertFromJson(Class<T> clazz, String json) {
+ if (clazz == null) {
+ throw new RuntimeException("The Class cannot be NULL!!!");
+ }
+
Gson gson = new Gson(); // Or use new GsonBuilder().create();
return gson.fromJson(json, clazz); // deserializes json into target2
}