aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src/main')
-rw-r--r--runtime/src/main/java/org/onap/policy/clamp/clds/util/JsonUtils.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/src/main/java/org/onap/policy/clamp/clds/util/JsonUtils.java b/runtime/src/main/java/org/onap/policy/clamp/clds/util/JsonUtils.java
index 909b240fb..7093952be 100644
--- a/runtime/src/main/java/org/onap/policy/clamp/clds/util/JsonUtils.java
+++ b/runtime/src/main/java/org/onap/policy/clamp/clds/util/JsonUtils.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP CLAMP
* ================================================================================
- * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights
+ * Copyright (C) 2018-2021 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -40,12 +40,16 @@ public class JsonUtils {
protected static final Logger logger = LoggerFactory.getLogger(JsonUtils.class);
- public static final Gson GSON = new GsonBuilder().setPrettyPrinting()
+ public static final Gson GSON = new GsonBuilder()
+ .registerTypeAdapter(Instant.class, new InstantSerializer())
+ .registerTypeAdapter(Instant.class, new InstantDeserializer())
+ .setPrettyPrinting()
.registerTypeAdapter(SecureServicePermission.class, new SecureServicePermissionDeserializer()).create();
- public static final Gson GSON_JPA_MODEL = new GsonBuilder().setPrettyPrinting()
+ public static final Gson GSON_JPA_MODEL = new GsonBuilder()
.registerTypeAdapter(Instant.class, new InstantSerializer())
.registerTypeAdapter(Instant.class, new InstantDeserializer()).setPrettyPrinting()
+ .setPrettyPrinting()
.excludeFieldsWithoutExposeAnnotation().create();
private JsonUtils() {