aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/aai/graphgraph/velocity/VelocityEntityProperty.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/aai/graphgraph/velocity/VelocityEntityProperty.java')
-rw-r--r--src/main/java/org/onap/aai/graphgraph/velocity/VelocityEntityProperty.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/main/java/org/onap/aai/graphgraph/velocity/VelocityEntityProperty.java b/src/main/java/org/onap/aai/graphgraph/velocity/VelocityEntityProperty.java
index 2c65ae3..a6c404e 100644
--- a/src/main/java/org/onap/aai/graphgraph/velocity/VelocityEntityProperty.java
+++ b/src/main/java/org/onap/aai/graphgraph/velocity/VelocityEntityProperty.java
@@ -20,15 +20,19 @@
package org.onap.aai.graphgraph.velocity;
import java.util.UUID;
+
+import org.eclipse.jetty.util.StringUtil;
import org.onap.aai.graphgraph.dto.Property;
public class VelocityEntityProperty extends Property {
private final VelocityEntity entity;
private final String propertyId;
+ private final String description;
- public VelocityEntityProperty(String propertyName, String propertyValue, VelocityEntity entity) {
+ public VelocityEntityProperty(String propertyName, String propertyValue, String propertyDescription, VelocityEntity entity) {
super(propertyName, propertyValue);
+ this.description = propertyDescription;
this.entity = entity;
propertyId = entity != null ? entity.getRandomId() : UUID.randomUUID().toString();
}
@@ -41,6 +45,10 @@ public class VelocityEntityProperty extends Property {
return entity.getName();
}
+ public boolean hasDescription() {
+ return !StringUtil.isBlank(description);
+ }
+
public boolean hasEntity() {
return entity != null;
}
@@ -49,8 +57,16 @@ public class VelocityEntityProperty extends Property {
return propertyId;
}
+ public String getDescription() {
+ return description;
+ }
+
+ public static String getRandomId() {
+ return UUID.randomUUID().toString();
+ }
+
@Override
public String toString() {
- return "VelocityEntityProperty{" + " name=" + getPropertyName() + " type=" + getPropertyValue() + '}';
+ return "VelocityEntityProperty{" + " name=" + getPropertyName() + " description=" + getDescription() + " type=" + getPropertyValue() + '}';
}
}