aboutsummaryrefslogtreecommitdiffstats
path: root/utils/src/main/java/org/onap/policy/common/utils/coder/Coder.java
diff options
context:
space:
mode:
Diffstat (limited to 'utils/src/main/java/org/onap/policy/common/utils/coder/Coder.java')
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/coder/Coder.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/utils/src/main/java/org/onap/policy/common/utils/coder/Coder.java b/utils/src/main/java/org/onap/policy/common/utils/coder/Coder.java
index bb51f2b9..ec0e5e42 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/coder/Coder.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/coder/Coder.java
@@ -1,8 +1,8 @@
/*
* ============LICENSE_START=======================================================
- * ONAP PAP
+ * ONAP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,6 +41,16 @@ public interface Coder {
String encode(Object object) throws CoderException;
/**
+ * Encodes an object into json, optionally making it "pretty".
+ *
+ * @param object object to be encoded
+ * @param pretty {@code true} if it should be encoded as "pretty" json, {@code false} otherwise
+ * @return a json string representing the object
+ * @throws CoderException if an error occurs
+ */
+ String encode(Object object, boolean pretty) throws CoderException;
+
+ /**
* Encodes an object into json, writing to the given target.
*
* @param target target to which to write the encoded json