aboutsummaryrefslogtreecommitdiffstats
path: root/utils/src/main/java/org/onap/policy/common/utils/coder/StandardYamlCoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'utils/src/main/java/org/onap/policy/common/utils/coder/StandardYamlCoder.java')
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/coder/StandardYamlCoder.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/utils/src/main/java/org/onap/policy/common/utils/coder/StandardYamlCoder.java b/utils/src/main/java/org/onap/policy/common/utils/coder/StandardYamlCoder.java
index 36f15b96..d94ddca4 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/coder/StandardYamlCoder.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/coder/StandardYamlCoder.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* 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.
@@ -34,7 +34,18 @@ public class StandardYamlCoder extends StandardCoder {
* Constructs the object.
*/
public StandardYamlCoder() {
- translator = new YamlJsonTranslator(getGSON());
+ translator = new YamlJsonTranslator(gson) {
+ @Override
+ protected <T> T convertFromDouble(Class<T> clazz, T value) {
+ return StandardYamlCoder.this.convertFromDouble(clazz, value);
+ }
+ };
+ }
+
+ @Override
+ protected String toPrettyJson(Object object) {
+ // YAML is already "pretty"
+ return toJson(object);
}
@Override