aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/clamp/clds/model/CldsDictionary.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/clamp/clds/model/CldsDictionary.java')
-rw-r--r--src/main/java/org/onap/clamp/clds/model/CldsDictionary.java296
1 files changed, 148 insertions, 148 deletions
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsDictionary.java b/src/main/java/org/onap/clamp/clds/model/CldsDictionary.java
index a696494e5..27a430c7c 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsDictionary.java
+++ b/src/main/java/org/onap/clamp/clds/model/CldsDictionary.java
@@ -36,153 +36,153 @@ import com.google.gson.annotations.Expose;
public class CldsDictionary {
- @Expose
- private String dictionaryId;
- @Expose
- private String dictionaryName;
-
- @Expose
- private String createdBy;
- @Expose
- private String updatedBy;
- @Expose
- private String lastUpdatedDate;
- @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.
- *
- * @return the dictionaryId
- */
- public String getDictionaryId() {
- return dictionaryId;
- }
-
- /**
- * Set the dictionary Id.
- *
- * @param dictionaryId the dictionaryId to set
- */
- public void setDictionaryId(String dictionaryId) {
- this.dictionaryId = dictionaryId;
- }
-
- /**
- * Get the dictionary name.
- *
- * @return the dictionaryName
- */
- public String getDictionaryName() {
- return dictionaryName;
- }
-
- /**
- * Set the dictionary name.
- *
- * @param dictionaryName the dictionaryName to set
- */
- public void setDictionaryName(String dictionaryName) {
- this.dictionaryName = dictionaryName;
- }
-
- /**
- * Get the createdBy info.
- *
- * @return the createdBy
- */
- public String getCreatedBy() {
- return createdBy;
- }
-
- /**
- * Set the createdBy info.
- *
- * @param createdBy the createdBy to set
- */
- public void setCreatedBy(String createdBy) {
- this.createdBy = createdBy;
- }
-
- /**
- * Get the updatedBy info.
- *
- * @return the updatedBy
- */
- public String getUpdatedBy() {
- return updatedBy;
- }
-
- /**
- * Set the updatedBy info.
- *
- * @param updatedby the updatedBy to set
- */
- public void setUpdatedBy(String updatedby) {
- updatedBy = updatedby;
- }
-
- /**
- * Get the last updated date.
- *
- * @return the lastUpdatedDate
- */
- public String getLastUpdatedDate() {
- return lastUpdatedDate;
- }
-
- /**
- * Set the last updated date.
- *
- * @param lastUpdatedDate the lastUpdatedDate to set
- */
- public void setLastUpdatedDate(String lastUpdatedDate) {
- this.lastUpdatedDate = lastUpdatedDate;
- }
-
- /**
- * Get all the dictionary items.
- *
- * @return the cldsDictionaryItems
- */
- public List<CldsDictionaryItem> getCldsDictionaryItems() {
- return cldsDictionaryItems;
- }
-
- /**
- * Set the whole dictionary items.
- *
- * @param cldsDictionaryItems the cldsDictionaryItems to set
- */
- public void setCldsDictionaryItems(List<CldsDictionaryItem> cldsDictionaryItems) {
- this.cldsDictionaryItems = cldsDictionaryItems;
- }
+ @Expose
+ private String dictionaryId;
+ @Expose
+ private String dictionaryName;
+
+ @Expose
+ private String createdBy;
+ @Expose
+ private String updatedBy;
+ @Expose
+ private String lastUpdatedDate;
+ @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.
+ *
+ * @return the dictionaryId
+ */
+ public String getDictionaryId() {
+ return dictionaryId;
+ }
+
+ /**
+ * Set the dictionary Id.
+ *
+ * @param dictionaryId the dictionaryId to set
+ */
+ public void setDictionaryId(String dictionaryId) {
+ this.dictionaryId = dictionaryId;
+ }
+
+ /**
+ * Get the dictionary name.
+ *
+ * @return the dictionaryName
+ */
+ public String getDictionaryName() {
+ return dictionaryName;
+ }
+
+ /**
+ * Set the dictionary name.
+ *
+ * @param dictionaryName the dictionaryName to set
+ */
+ public void setDictionaryName(String dictionaryName) {
+ this.dictionaryName = dictionaryName;
+ }
+
+ /**
+ * Get the createdBy info.
+ *
+ * @return the createdBy
+ */
+ public String getCreatedBy() {
+ return createdBy;
+ }
+
+ /**
+ * Set the createdBy info.
+ *
+ * @param createdBy the createdBy to set
+ */
+ public void setCreatedBy(String createdBy) {
+ this.createdBy = createdBy;
+ }
+
+ /**
+ * Get the updatedBy info.
+ *
+ * @return the updatedBy
+ */
+ public String getUpdatedBy() {
+ return updatedBy;
+ }
+
+ /**
+ * Set the updatedBy info.
+ *
+ * @param updatedby the updatedBy to set
+ */
+ public void setUpdatedBy(String updatedby) {
+ updatedBy = updatedby;
+ }
+
+ /**
+ * Get the last updated date.
+ *
+ * @return the lastUpdatedDate
+ */
+ public String getLastUpdatedDate() {
+ return lastUpdatedDate;
+ }
+
+ /**
+ * Set the last updated date.
+ *
+ * @param lastUpdatedDate the lastUpdatedDate to set
+ */
+ public void setLastUpdatedDate(String lastUpdatedDate) {
+ this.lastUpdatedDate = lastUpdatedDate;
+ }
+
+ /**
+ * Get all the dictionary items.
+ *
+ * @return the cldsDictionaryItems
+ */
+ public List<CldsDictionaryItem> getCldsDictionaryItems() {
+ return cldsDictionaryItems;
+ }
+
+ /**
+ * Set the whole dictionary items.
+ *
+ * @param cldsDictionaryItems the cldsDictionaryItems to set
+ */
+ public void setCldsDictionaryItems(List<CldsDictionaryItem> cldsDictionaryItems) {
+ this.cldsDictionaryItems = cldsDictionaryItems;
+ }
}