From 2b0f2c80b55deb785c2b08268fc5d020e12d4be9 Mon Sep 17 00:00:00 2001 From: Shinu John Date: Wed, 21 Nov 2018 15:47:49 +0000 Subject: Fixing JsonMappingException issue Change-Id: I6654464a85152058787e5ce2530c0cf332c8e6e0 Issue-ID: SO-1236 Signed-off-by: Shinu John --- .../java/org/onap/so/bpmn/core/RollbackData.java | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'bpmn/MSOCoreBPMN') diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/RollbackData.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/RollbackData.java index 9c80548490..52207f2156 100644 --- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/RollbackData.java +++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/RollbackData.java @@ -25,24 +25,26 @@ import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; +import com.fasterxml.jackson.annotation.JsonProperty; + /** - * An object that stores data for rollbacks. Data is organized by type. A - * type is simply a string identifier. Multiple types of data may be stored - * in the same object for separate rollback operations. + * An object that stores data for rollbacks. Data is organized by type. A type is simply a string + * identifier. Multiple types of data may be stored in the same object for separate rollback + * operations. */ public class RollbackData implements Serializable { private static final long serialVersionUID = 1L; - private Map> dictionary = - new HashMap<>(); + @JsonProperty + private final Map> dictionary = new HashMap<>(); /** * Returns true if the specified type is stored in this object. * * @param type the data type */ - public boolean hasType(String type) { + public boolean hasType(final String type) { return dictionary.containsKey(type); } @@ -53,9 +55,8 @@ public class RollbackData implements Serializable { * @param key the key * @param value the value */ - public void put(String type, String key, String value) { - Map mapForType = dictionary - .computeIfAbsent(type, k -> new HashMap<>()); + public void put(final String type, final String key, final String value) { + final Map mapForType = dictionary.computeIfAbsent(type, k -> new HashMap<>()); mapForType.put(key, value); } @@ -67,8 +68,8 @@ public class RollbackData implements Serializable { * @param key the key * @return the item or null if there is no item for the specified type and key */ - public Serializable get(String type, String key) { - Map mapForType = dictionary.get(type); + public Serializable get(final String type, final String key) { + final Map mapForType = dictionary.get(type); if (mapForType == null) { return null; @@ -83,7 +84,7 @@ public class RollbackData implements Serializable { * @param type the data type * @return a map, or null if there are no items associated with the specified data type */ - public Map get(String type) { + public Map get(final String type) { return dictionary.get(type); } -- cgit 1.2.3-korg