Remove class serialization
[aai/data-router.git] / src / main / java / org / onap / aai / datarouter / entity / SuggestionSearchEntity.java
index a41487e..bb02159 100644 (file)
@@ -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<String, String> inputOutputData = new HashMap<>();
   private Map<String, UiFilterConfig> 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<String> listOfSearchSuggestionPermutations = new ArrayList<String>();
+    ArrayList<String> listOfSearchSuggestionPermutations = new ArrayList<>();
     ArrayList<String> 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;
   }