Adding back-end support for UI filters
[aai/sparky-be.git] / src / main / java / org / onap / aai / sparky / synchronizer / entity / AggregationEntity.java
index af8159a..b2958b1 100644 (file)
@@ -37,7 +37,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
 public class AggregationEntity extends IndexableEntity implements IndexDocument {
   private Map<String, String> attributes = new HashMap<String, String>();
   protected ObjectMapper mapper = new ObjectMapper();
-  
+
   /**
    * Instantiates a new aggregation entity.
    */
@@ -54,7 +54,9 @@ public class AggregationEntity extends IndexableEntity implements IndexDocument
     super(loader);
   }
 
-  /* (non-Javadoc)
+  /*
+   * (non-Javadoc)
+   * 
    * @see org.onap.aai.sparky.synchronizer.entity.IndexDocument#deriveFields()
    */
   @Override
@@ -66,19 +68,20 @@ public class AggregationEntity extends IndexableEntity implements IndexDocument
      * The best we can hope for is identification of resources by generated Id until the
      * Identity-Service UUID is tagged against all resources, then we can use that instead.
      */
-    this.id =
-        NodeUtils.generateUniqueShaDigest(link);
+    this.id = NodeUtils.generateUniqueShaDigest(link);
   }
 
-  public void copyAttributeKeyValuePair(Map<String, Object> map){
-    for(String key: map.keySet()){
-      if (!key.equalsIgnoreCase("relationship-list")){   // ignore relationship data which is not required in aggregation
-        this.attributes.put(key, map.get(key).toString());    // not sure if entity attribute can contain an object as value
+  public void copyAttributeKeyValuePair(Map<String, Object> map) {
+    for (String key : map.keySet()) {
+      if (!key.equalsIgnoreCase("relationship-list")) { // ignore relationship data which is not
+                                                        // required in aggregation
+        this.attributes.put(key, map.get(key).toString()); // not sure if entity attribute can
+                                                           // contain an object as value
       }
     }
   }
-  
-  public void addAttributeKeyValuePair(String key, String value){
+
+  public void addAttributeKeyValuePair(String key, String value) {
     this.attributes.put(key, value);
   }
 
@@ -87,7 +90,7 @@ public class AggregationEntity extends IndexableEntity implements IndexDocument
     ObjectNode rootNode = mapper.createObjectNode();
     rootNode.put("link", this.getLink());
     rootNode.put("lastmodTimestamp", this.getEntityTimeStamp());
-    for (String key: this.attributes.keySet()){
+    for (String key : this.attributes.keySet()) {
       rootNode.put(key, this.attributes.get(key));
     }
     return rootNode.toString();
@@ -121,13 +124,15 @@ public class AggregationEntity extends IndexableEntity implements IndexDocument
     this.mapper = mapper;
   }
 
-@Override
+  @Override
   public ObjectNode getBulkImportEntity() {
     // TODO Auto-generated method stub
     return null;
   }
 
-  /* (non-Javadoc)
+  /*
+   * (non-Javadoc)
+   * 
    * @see java.lang.Object#toString()
    */
   @Override