X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fdatarouter%2Fentity%2FSuggestionSearchEntity.java;h=bb02159bef524bf311d0a23bcd67929b841ded85;hb=HEAD;hp=a41487ea8ca013d06b5002b0b31b2ace10ae8463;hpb=da309841ad25ab47537a6d2de00cd98bd113392c;p=aai%2Fdata-router.git diff --git a/src/main/java/org/onap/aai/datarouter/entity/SuggestionSearchEntity.java b/src/main/java/org/onap/aai/datarouter/entity/SuggestionSearchEntity.java index a41487e..bb02159 100644 --- a/src/main/java/org/onap/aai/datarouter/entity/SuggestionSearchEntity.java +++ b/src/main/java/org/onap/aai/datarouter/entity/SuggestionSearchEntity.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017 Amdocs + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 Amdocs * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,6 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ package org.onap.aai.datarouter.entity; @@ -32,16 +30,15 @@ import java.util.Map; import org.json.JSONArray; import org.json.JSONObject; -import org.openecomp.datarouter.search.filters.config.UiFilterConfig; -import org.openecomp.datarouter.search.filters.config.UiFiltersConfig; -import org.openecomp.datarouter.search.filters.config.UiFiltersSchemaUtility; -import org.openecomp.datarouter.util.NodeUtils; -import org.openecomp.datarouter.util.SearchSuggestionPermutation; +import org.onap.aai.datarouter.search.filters.config.UiFilterConfig; +import org.onap.aai.datarouter.search.filters.config.UiFiltersConfig; +import org.onap.aai.datarouter.search.filters.config.UiFiltersSchemaUtility; +import org.onap.aai.datarouter.util.NodeUtils; +import org.onap.aai.datarouter.util.SearchSuggestionPermutation; import com.fasterxml.jackson.databind.JsonNode; -public class SuggestionSearchEntity implements DocumentStoreDataEntity, Serializable { - private static final long serialVersionUID = -3636393943669310760L; +public class SuggestionSearchEntity implements DocumentStoreDataEntity { private static final String FILTER_ID = "filterId"; private static final String FILTER_VALUE = "filterValue"; @@ -57,7 +54,7 @@ public class SuggestionSearchEntity implements DocumentStoreDataEntity, Serializ private Map inputOutputData = new HashMap<>(); private Map filters = new HashMap<>(); private JSONObject filterPayload = new JSONObject(); - private StringBuffer searchSuggestionDisplayString = new StringBuffer(); + private StringBuilder searchSuggestionDisplayString = new StringBuilder(); private JSONArray payloadFilters = new JSONArray(); private UiFiltersSchemaUtility filtersSchemaUtility = new UiFiltersSchemaUtility(); @@ -124,7 +121,7 @@ public class SuggestionSearchEntity implements DocumentStoreDataEntity, Serializ } } - ArrayList listOfSearchSuggestionPermutations = new ArrayList(); + ArrayList listOfSearchSuggestionPermutations = new ArrayList<>(); ArrayList listToPermutate = new ArrayList<>(this.getInputOutputData().values()); @@ -152,7 +149,7 @@ public class SuggestionSearchEntity implements DocumentStoreDataEntity, Serializ JSONObject rootNode = new JSONObject(); JSONArray inputArray = new JSONArray(); JSONObject payloadNode = new JSONObject(); - StringBuffer outputString = new StringBuffer(); + StringBuilder outputString = new StringBuilder(); int payloadEntryCounter = 1; @@ -240,10 +237,10 @@ public class SuggestionSearchEntity implements DocumentStoreDataEntity, Serializ inputOutputData.put(attribute, entityFromUebEvent.get(attribute).asText()); if(filterConfig != null) { - JSONObject filterPayload = new JSONObject(); - filterPayload.put(FILTER_ID, filterConfig.getFilterId()); - filterPayload.put(FILTER_VALUE, entityFromUebEvent.get(attribute).asText()); - this.payloadFilters.put(filterPayload); + JSONObject jsonFilterPayload = new JSONObject(); + jsonFilterPayload.put(FILTER_ID, filterConfig.getFilterId()); + jsonFilterPayload.put(FILTER_VALUE, entityFromUebEvent.get(attribute).asText()); + this.payloadFilters.put(jsonFilterPayload); } else { this.filterPayload.put(attribute, entityFromUebEvent.get(attribute).asText()); } @@ -292,7 +289,7 @@ public class SuggestionSearchEntity implements DocumentStoreDataEntity, Serializ return id; } - public StringBuffer getSearchSuggestionDisplayString() { + public StringBuilder getSearchSuggestionDisplayString() { return searchSuggestionDisplayString; } @@ -324,7 +321,7 @@ public class SuggestionSearchEntity implements DocumentStoreDataEntity, Serializ return inputOutputData; } - public void setSearchSuggestionDisplayString(StringBuffer searchSuggestionDisplayString) { + public void setSearchSuggestionDisplayString(StringBuilder searchSuggestionDisplayString) { this.searchSuggestionDisplayString = searchSuggestionDisplayString; }