summaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters/src
diff options
context:
space:
mode:
authorSindhuri.A <arcot.sindhuri@huawei.com>2019-04-19 21:38:31 +0530
committerSindhuri.A <arcot.sindhuri@huawei.com>2019-04-19 21:38:31 +0530
commitc43f629d51302e70f317d04db249d3a72835fa30 (patch)
treea2cb883e81319532764c37a2f313b5eada642ad7 /adapters/mso-openstack-adapters/src
parent0943ee25bcdb181d926c12678db932ed3f100da3 (diff)
Replace String Literals with Constant
Replace String Literals with Constant NetworkAdapterRest class Issue-ID: SO-1490 Change-Id: I2b8aa59b971da7af1b1abda0fd137f55d3a32284 Signed-off-by: Sindhuri.A <arcot.sindhuri@huawei.com>
Diffstat (limited to 'adapters/mso-openstack-adapters/src')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
index c15fc0d204..b12d2397f9 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
@@ -87,6 +87,7 @@ public class NetworkAdapterRest {
private static final Logger logger = LoggerFactory.getLogger(NetworkAdapterRest.class);
private static final String TESTING_KEYWORD = "___TESTING___";
private String exceptionMsg = "Exception:";
+ private static final String SHARED = "shared";
@Autowired
private MsoNetworkAdapterImpl adapter;
@@ -170,7 +171,7 @@ public class NetworkAdapterRest {
HashMap<String, String> params = (HashMap<String, String>) req.getNetworkParams();
if (params == null) {
- params = new HashMap<String, String>();
+ params = new HashMap<>();
}
String shared = null;
String external = null;
@@ -192,8 +193,8 @@ public class NetworkAdapterRest {
ctn = new ContrailNetwork();
req.setContrailNetwork(ctn);
}
- if (params.containsKey("shared")) {
- shared = params.get("shared");
+ if (params.containsKey(SHARED)) {
+ shared = params.get(SHARED);
} else {
if (ctn.getShared() != null) {
shared = ctn.getShared();
@@ -218,8 +219,8 @@ public class NetworkAdapterRest {
pvn = new ProviderVlanNetwork();
req.setProviderVlanNetwork(pvn);
}
- if (params.containsKey("shared"))
- shared = params.get("shared");
+ if (params.containsKey(SHARED))
+ shared = params.get(SHARED);
if (params.containsKey("external"))
external = params.get("external");
adapter.createNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(),
@@ -573,8 +574,8 @@ public class NetworkAdapterRest {
ctn = new ContrailNetwork();
req.setContrailNetwork(ctn);
}
- if (params.containsKey("shared")) {
- shared = params.get("shared");
+ if (params.containsKey(SHARED)) {
+ shared = params.get(SHARED);
} else {
if (ctn.getShared() != null) {
shared = ctn.getShared();
@@ -598,8 +599,8 @@ public class NetworkAdapterRest {
pvn = new ProviderVlanNetwork();
req.setProviderVlanNetwork(pvn);
}
- if (params.containsKey("shared")) {
- shared = params.get("shared");
+ if (params.containsKey(SHARED)) {
+ shared = params.get(SHARED);
}
if (params.containsKey("external")) {
external = params.get("external");