diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2019-04-20 06:51:28 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-20 06:51:28 +0000 |
commit | 89b10492876c34072ecbc87b8e7afa8589d4dcea (patch) | |
tree | b05678720c0dae5a5fdab705e7ae41b09480e7a7 /adapters | |
parent | 075fe6b0c3cfc19223748a66450e10d28754fdf3 (diff) | |
parent | c43f629d51302e70f317d04db249d3a72835fa30 (diff) |
Merge "Replace String Literals with Constant"
Diffstat (limited to 'adapters')
-rw-r--r-- | adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java | 19 |
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"); |