Update transportpce-common-types model
[transportpce.git] / renderer / src / main / java / org / opendaylight / transportpce / renderer / provisiondevice / DeviceRenderingResult.java
index c49b9728ec495fac4ad9375fdc2118d4b494acce..38869e9afe8b8efc27892229fbf9ec0093be746f 100644 (file)
@@ -10,28 +10,31 @@ package org.opendaylight.transportpce.renderer.provisiondevice;
 import java.util.Collections;
 import java.util.List;
 import org.opendaylight.transportpce.common.OperationResult;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.node.interfaces.NodeInterface;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.link.tp.LinkTp;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.node.interfaces.NodeInterface;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.optical.renderer.nodes.Nodes;
 
 public final class DeviceRenderingResult extends OperationResult {
 
     private final List<Nodes> olmList;
     private final List<NodeInterface> renderedNodeInterfaces;
+    private final List<LinkTp> otnLinkTps;
 
     private DeviceRenderingResult(boolean success, String message, List<Nodes> olmList,
-            List<NodeInterface> renderedNodeInterfaces) {
+            List<NodeInterface> renderedNodeInterfaces, List<LinkTp> otnLinkTps) {
         super(success, message);
-        if (olmList != null) {
-            this.olmList = Collections.unmodifiableList(olmList);
-        } else {
-            this.olmList = Collections.emptyList();
-        }
-
-        if (renderedNodeInterfaces != null) {
-            this.renderedNodeInterfaces = Collections.unmodifiableList(renderedNodeInterfaces);
-        } else {
-            this.renderedNodeInterfaces = Collections.emptyList();
-        }
+        this.olmList =
+            olmList == null
+                ? Collections.emptyList()
+                : Collections.unmodifiableList(olmList);
+        this.renderedNodeInterfaces =
+            renderedNodeInterfaces == null
+                ? Collections.emptyList()
+                : Collections.unmodifiableList(renderedNodeInterfaces);
+        this.otnLinkTps =
+            otnLinkTps == null
+                ? Collections.emptyList()
+                : Collections.unmodifiableList(otnLinkTps);
     }
 
     public List<Nodes> getOlmList() {
@@ -42,12 +45,17 @@ public final class DeviceRenderingResult extends OperationResult {
         return this.renderedNodeInterfaces;
     }
 
+    public List<LinkTp> getOtnLinkTps() {
+        return this.otnLinkTps;
+    }
+
     public static DeviceRenderingResult failed(String message) {
-        return new DeviceRenderingResult(false, message, null, null);
+        return new DeviceRenderingResult(false, message, null, null, null);
     }
 
-    public static DeviceRenderingResult ok(List<Nodes> olmList, List<NodeInterface> renderedNodeInterfaces) {
-        return new DeviceRenderingResult(true, "", olmList, renderedNodeInterfaces);
+    public static DeviceRenderingResult ok(List<Nodes> olmNodeList, List<NodeInterface> renderedNodeInterfaces,
+            List<LinkTp> otnLinkTps) {
+        return new DeviceRenderingResult(true, "", olmNodeList, renderedNodeInterfaces, otnLinkTps);
     }
 
 }