diff options
author | Shinu John <shinu.john@ericsson.com> | 2018-11-21 15:47:49 +0000 |
---|---|---|
committer | Shinu John <shinu.john@ericsson.com> | 2018-11-21 15:53:20 +0000 |
commit | 2b0f2c80b55deb785c2b08268fc5d020e12d4be9 (patch) | |
tree | f7f0acefabf80f31298e111d6904b375c6b4d85d /bpmn/MSOCoreBPMN/src/main/java | |
parent | 7f4adc268168464dcbc51f8730d570198979b16e (diff) |
Fixing JsonMappingException issue
Change-Id: I6654464a85152058787e5ce2530c0cf332c8e6e0
Issue-ID: SO-1236
Signed-off-by: Shinu John <shinu.john@ericsson.com>
Diffstat (limited to 'bpmn/MSOCoreBPMN/src/main/java')
-rw-r--r-- | bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/RollbackData.java | 25 |
1 files changed, 13 insertions, 12 deletions
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<String, Map<String, Serializable>> dictionary = - new HashMap<>(); + @JsonProperty + private final Map<String, Map<String, Serializable>> 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<String, Serializable> mapForType = dictionary - .computeIfAbsent(type, k -> new HashMap<>()); + public void put(final String type, final String key, final String value) { + final Map<String, Serializable> 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<String, Serializable> mapForType = dictionary.get(type); + public Serializable get(final String type, final String key) { + final Map<String, Serializable> 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<String, Serializable> get(String type) { + public Map<String, Serializable> get(final String type) { return dictionary.get(type); } |