Remove dead code
[clamp.git] / src / main / java / org / onap / clamp / clds / model / CldsDictionary.java
index 27a430c..35fbcec 100644 (file)
 
 package org.onap.clamp.clds.model;
 
+import com.google.gson.annotations.Expose;
+
 import java.util.ArrayList;
 import java.util.List;
 
-import org.onap.clamp.clds.dao.CldsDao;
-
-import com.google.gson.annotations.Expose;
-
 /**
  * Represents a CLDS Dictionary.
  */
@@ -50,33 +48,6 @@ public class CldsDictionary {
     @Expose
     private List<CldsDictionaryItem> cldsDictionaryItems = new ArrayList<>();
 
-    /**
-     * Creates or updates dictionary item for a dictionary in DB.
-     *
-     * @param dictionaryName The dictionary name
-     * @param cldsDao        The CldsDao
-     * @param userId         The user ID
-     */
-    public void save(String dictionaryName, CldsDao cldsDao, String userId) {
-        List<CldsDictionary> list = cldsDao.getDictionary(this.getDictionaryId(), dictionaryName);
-        if (list != null && !list.isEmpty()) {
-            CldsDictionary cldsDictionary = list.stream().findFirst().get();
-            if (!cldsDictionary.getDictionaryName().equalsIgnoreCase(this.getDictionaryName())) {
-                cldsDao.updateDictionary(cldsDictionary.getDictionaryId(), this, userId);
-                this.setCreatedBy(cldsDictionary.getCreatedBy());
-            } else {
-                this.setDictionaryId(cldsDictionary.getDictionaryId());
-                this.setCreatedBy(cldsDictionary.getCreatedBy());
-                this.setUpdatedBy(cldsDictionary.getUpdatedBy());
-                this.setLastUpdatedDate(cldsDictionary.getLastUpdatedDate());
-            }
-        } else {
-            this.setCreatedBy(userId);
-            this.setUpdatedBy(userId);
-            cldsDao.insDictionary(this);
-        }
-    }
-
     /**
      * Get the dictionary ID.
      *