summaryrefslogtreecommitdiffstats
path: root/catalog-dao/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-dao/src/main')
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java33
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/JsonUtil.java6
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java35
3 files changed, 16 insertions, 58 deletions
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java
index 7e64605228..ff40d06fc5 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java
@@ -21,14 +21,16 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables;
import com.datastax.driver.core.DataType;
import java.util.Map;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
public class DistribStatusEventTableDesc extends DistribBaseEventTableDesc {
@Override
- protected void updateColumnDistribDescription(Map<String, ImmutablePair<DataType, Boolean>> columns) {
- for (DSEFieldsDescription field : DSEFieldsDescription.values()) {
+ protected void updateColumnDistribDescription(final Map<String, ImmutablePair<DataType, Boolean>> columns) {
+ for (final DSEFieldsDescription field : DSEFieldsDescription.values()) {
columns.put(field.getName(), new ImmutablePair<>(field.type, field.indexed));
}
}
@@ -38,7 +40,9 @@ public class DistribStatusEventTableDesc extends DistribBaseEventTableDesc {
return AuditingTypesConstants.DISTRIBUTION_STATUS_EVENT_TYPE;
}
- enum DSEFieldsDescription {
+ @Getter
+ @AllArgsConstructor
+ private enum DSEFieldsDescription {
// @formatter:off
DID("did", DataType.varchar(), true),
CONSUMER_ID("consumer_id", DataType.varchar(), false),
@@ -47,26 +51,9 @@ public class DistribStatusEventTableDesc extends DistribBaseEventTableDesc {
STATUS_TIME("status_time", DataType.varchar(), false);
// @formatter:on
- private String name;
- private DataType type;
- private boolean indexed;
+ private final String name;
+ private final DataType type;
+ private final boolean indexed;
- DSEFieldsDescription(String name, DataType type, boolean indexed) {
- this.name = name;
- this.type = type;
- this.indexed = indexed;
- }
-
- public String getName() {
- return name;
- }
-
- public DataType getType() {
- return type;
- }
-
- public boolean isIndexed() {
- return indexed;
- }
}
}
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/JsonUtil.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/JsonUtil.java
index ebcb1d5271..8153d44be7 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/JsonUtil.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/JsonUtil.java
@@ -139,10 +139,4 @@ public final class JsonUtil {
return mapper.readValue(json, type);
}
- public static <T> List<T> toList(String json, Class<T> elementClass, Class<?> elementGenericClass) throws IOException {
- ObjectMapper mapper = getOneObjectMapper();
- JavaType elementType = mapper.getTypeFactory().constructParametricType(elementClass, elementGenericClass);
- JavaType listType = mapper.getTypeFactory().constructCollectionType(List.class, elementType);
- return mapper.readValue(json, listType);
- }
}
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java
index 229d774222..f4f92941c7 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CategoryData.java
@@ -21,10 +21,16 @@ package org.openecomp.sdc.be.resources.data;
import java.util.HashMap;
import java.util.Map;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
import org.openecomp.sdc.be.dao.graph.datatype.GraphNode;
import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary;
import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
+@Getter
+@Setter
+@ToString
public abstract class CategoryData extends GraphNode {
private String name;
@@ -59,38 +65,9 @@ public abstract class CategoryData extends GraphNode {
return map;
}
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getNormalizedName() {
- return normalizedName;
- }
-
- public void setNormalizedName(String normalizedName) {
- this.normalizedName = normalizedName;
- }
-
- @Override
- public String toString() {
- return "CategoryData [name=" + name + ", normalizedName=" + normalizedName + "uniqueId=" + uniqueId + "]";
- }
-
@Override
public String getUniqueIdKey() {
return GraphPropertiesDictionary.UNIQUE_ID.getProperty();
}
- @Override
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
}