diff options
Diffstat (limited to 'adapters/mso-adapters-rest-interface/src/main')
5 files changed, 12 insertions, 10 deletions
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java index 6d3f8f7b1c..f51cb0dd64 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java @@ -55,7 +55,7 @@ public class MapDeserializer extends JsonDeserializer<Map<String, String>> { ObjectMapper mapper = new ObjectMapper(); JsonNode tree = mapper.readTree(parser); - Map<String, String> map = new LinkedHashMap<String, String>(); + Map<String, String> map = new LinkedHashMap<>(); Iterator<JsonNode> iterator = tree.iterator(); while (iterator.hasNext()) { @@ -71,4 +71,4 @@ public class MapDeserializer extends JsonDeserializer<Map<String, String>> { return map; } -}
\ No newline at end of file +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java index 1db69f41ab..c2ea8242c3 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java @@ -53,8 +53,9 @@ public class MapSerializer extends JsonSerializer<Map<String, String>> { jsonGenerator.writeStartObject(); jsonGenerator.writeArrayFieldStart("entry"); - for (String key : map.keySet()) { - String value = map.get(key); + for (Map.Entry<String,String> entry : map.entrySet()) { + String key = entry.getKey(); + String value = entry.getValue(); jsonGenerator.writeStartObject(); jsonGenerator.writeStringField("key", key); jsonGenerator.writeStringField("value", value); @@ -64,4 +65,4 @@ public class MapSerializer extends JsonSerializer<Map<String, String>> { jsonGenerator.writeEndArray(); jsonGenerator.writeEndObject(); } -}
\ No newline at end of file +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkResponse.java index f3c1c43617..88f6ad2705 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkResponse.java @@ -35,12 +35,13 @@ public class UpdateNetworkResponse extends NetworkResponseCommon { private String networkId; private String neutronNetworkId; private Map<String, String> subnetMap; - + public UpdateNetworkResponse() { + /* Empty Constructor */ } - + public UpdateNetworkResponse(String networkId, String neutronNetworkId, - Map<String, String> subnetMap, String messageId) { + Map<String, String> subnetMap, String messageId) { super(messageId); this.networkId = networkId; this.neutronNetworkId = neutronNetworkId; diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantRequest.java index 0d4a52c081..f54380486a 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantRequest.java @@ -35,7 +35,7 @@ public class CreateTenantRequest extends TenantRequestCommon { private String tenantName; private Boolean failIfExists; private Boolean backout; - private Map<String,String> metadata = new HashMap<String, String>(); + private Map<String,String> metadata = new HashMap<>(); private MsoRequest msoRequest = new MsoRequest(); public CreateTenantRequest() {} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRequestCommon.java index 98be3c1478..778a329979 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRequestCommon.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRequestCommon.java @@ -36,7 +36,7 @@ public class TenantRequestCommon { private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); public String toJsonString() { try { - String jsonString = null; + String jsonString; ObjectMapper mapper = new ObjectMapper(); mapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE); jsonString = mapper.writeValueAsString(this); |