diff options
Diffstat (limited to 'controlloop/common/model-impl/events/src/main')
-rw-r--r-- | controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/util/Serialization.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/util/Serialization.java b/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/util/Serialization.java index 9e6d1afc0..9578d9ac2 100644 --- a/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/util/Serialization.java +++ b/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/util/Serialization.java @@ -27,6 +27,8 @@ import java.time.format.DateTimeFormatter; import org.onap.policy.controlloop.ControlLoopNotificationType; import org.onap.policy.controlloop.ControlLoopTargetType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -38,10 +40,12 @@ import com.google.gson.JsonPrimitive; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; + public final class Serialization { public static class notificationTypeAdapter implements JsonSerializer<ControlLoopNotificationType>, JsonDeserializer<ControlLoopNotificationType> { + @Override public JsonElement serialize(ControlLoopNotificationType src, Type typeOfSrc, JsonSerializationContext context) { @@ -73,6 +77,7 @@ public final class Serialization { } public static class gsonUTCAdapter implements JsonSerializer<ZonedDateTime>, JsonDeserializer<ZonedDateTime> { + private static final Logger logger = LoggerFactory.getLogger(gsonUTCAdapter.class); public static final DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSSxxx"); public ZonedDateTime deserialize(JsonElement element, Type type, JsonDeserializationContext context) @@ -80,7 +85,7 @@ public final class Serialization { try { return ZonedDateTime.parse(element.getAsString(), format); } catch (Exception e) { - System.err.println(e); + logger.error(e.getMessage(), e); } return null; } |