summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/EventTypeDefinitionUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/EventTypeDefinitionUI.java')
-rw-r--r--src/main/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/EventTypeDefinitionUI.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/main/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/EventTypeDefinitionUI.java b/src/main/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/EventTypeDefinitionUI.java
new file mode 100644
index 0000000..667eb03
--- /dev/null
+++ b/src/main/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/EventTypeDefinitionUI.java
@@ -0,0 +1,50 @@
+package org.onap.sdc.dcae.composition.restmodels.ruleeditor;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class EventTypeDefinitionUI {
+
+ private String name;
+ private List<EventTypeDefinitionUI> children;
+ private Boolean isRequired;
+ private List<String> requiredChildren;
+ private String id;
+
+
+ public EventTypeDefinitionUI(String name, List<EventTypeDefinitionUI> children, Boolean isRequired, String id) {
+ super();
+ this.name = name;
+ this.children = children;
+ this.isRequired = isRequired;
+ this.id = id;
+ this.requiredChildren = (children == null) ? null : children.stream()
+ .filter(c-> c.isRequired)
+ .map(c-> c.name)
+ .collect(Collectors.toList());
+ }
+
+ public String getName() {
+ return name;
+ }
+
+
+ public List<EventTypeDefinitionUI> getChildren() {
+ return children;
+ }
+
+
+ public Boolean getIsRequired() {
+ return isRequired;
+ }
+
+
+ public List<String> getRequiredChildren() {
+ return requiredChildren;
+ }
+
+
+ public String getId() {
+ return id;
+ }
+}