diff options
author | 2018-07-12 11:02:18 +0100 | |
---|---|---|
committer | 2018-07-12 11:02:18 +0100 | |
commit | 194adee686ebb90488f739f2c637f6cb3def94d5 (patch) | |
tree | e0b5ddf0a188c559f81a228f124c246ddfdab648 /src/main/java/org/onap/crud/dao | |
parent | d5322dbd0fa1e32d543b24824a28d6bf0a0b5497 (diff) |
Fix sonar violations
Issue-ID: AAI-1190
Change-Id: I72894665b288416069d3c2eb84185fcc303976f7
Signed-off-by: Sotiropoulos, Ioannis (is948x) <Ioannis.Sotiropoulos@amdocs.com>
Diffstat (limited to 'src/main/java/org/onap/crud/dao')
-rw-r--r-- | src/main/java/org/onap/crud/dao/GraphDao.java | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/crud/dao/champ/ChampDao.java | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/onap/crud/dao/GraphDao.java b/src/main/java/org/onap/crud/dao/GraphDao.java index fe638ce..6c1bca9 100644 --- a/src/main/java/org/onap/crud/dao/GraphDao.java +++ b/src/main/java/org/onap/crud/dao/GraphDao.java @@ -20,9 +20,9 @@ */ package org.onap.crud.dao; -import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import org.onap.aai.restclient.client.OperationResult; import org.onap.crud.entity.Edge; import org.onap.crud.entity.Vertex; @@ -73,7 +73,7 @@ public interface GraphDao { * @return - The {@link OperationResult} OperationResult * @throws CrudException */ - public OperationResult getVertices(String type, Map<String, Object> filter, HashSet<String> properties, String version) throws CrudException; + public OperationResult getVertices(String type, Map<String, Object> filter, Set<String> properties, String version) throws CrudException; /** * Retrieve an {@link Edge} from the graph database by specifying its unique diff --git a/src/main/java/org/onap/crud/dao/champ/ChampDao.java b/src/main/java/org/onap/crud/dao/champ/ChampDao.java index 6817ea6..fd5de57 100644 --- a/src/main/java/org/onap/crud/dao/champ/ChampDao.java +++ b/src/main/java/org/onap/crud/dao/champ/ChampDao.java @@ -27,6 +27,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.apache.http.NameValuePair; @@ -168,7 +169,7 @@ public class ChampDao implements GraphDao { } @Override - public OperationResult getVertices(String type, Map<String, Object> filter, HashSet<String> properties, String version) throws CrudException { + public OperationResult getVertices(String type, Map<String, Object> filter, Set<String> properties, String version) throws CrudException { filter.put(org.onap.schema.validation.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type); List<NameValuePair> queryParams = convertToNameValuePair(filter); @@ -575,7 +576,7 @@ public class ChampDao implements GraphDao { } // https://stackoverflow.com/questions/26942330/convert-mapstring-string-to-listnamevaluepair-is-this-the-most-efficient - private List<NameValuePair> convertToNameValuePair(String k, HashSet<String> values) { + private List<NameValuePair> convertToNameValuePair(String k, Set<String> values) { List<NameValuePair> nvpList = new ArrayList<>(values.size()); values.forEach((v) -> nvpList.add(new BasicNameValuePair(k, v))); |