Merge dev/fluorine work across to master
[unimgr.git] / impl / src / main / java / org / opendaylight / unimgr / mef / nrp / api / EndPoint.java
index 7393da9097164b10eeb9725693b57eefdbfc99e1..983d781f4ed31be15b304ca8cc7f5e618d71be72 100644 (file)
@@ -8,12 +8,14 @@
 
 package org.opendaylight.unimgr.mef.nrp.api;
 
-import org.opendaylight.yang.gen.v1.urn.mef.yang.nrp._interface.rev171221.NrpConnectivityServiceEndPointAttrs;
-import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.Uuid;
-import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.connectivity.rev171113.ConnectivityServiceEndPoint;
-
 import java.util.Objects;
+import org.opendaylight.yang.gen.v1.urn.mef.yang.nrp._interface.rev180321.NrpConnectivityServiceEndPointAttrs;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev180307.ConnectivityServiceEndPoint;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev180307.OwnedNodeEdgePointRef;
+
+
 /**
+ * Class handling common attributes for presto yang endpoints.
  * @see ConnectivityServiceEndPoint
  * @author bartosz.michalik@amartus.com
  */
@@ -26,7 +28,8 @@ public class EndPoint {
      */
     private final NrpConnectivityServiceEndPointAttrs attrs;
 
-    private Uuid systemNepUuid;
+    private OwnedNodeEdgePointRef ref;
+    private String localId;
 
     /**
      * Initialize endpoint.
@@ -46,27 +49,40 @@ public class EndPoint {
         return attrs;
     }
 
-    public Uuid getSystemNepUuid() {
-        return systemNepUuid;
-    }
 
-    public EndPoint setSystemNepUuid(Uuid systemNepUuid) {
-        this.systemNepUuid = systemNepUuid;
+    public EndPoint setNepRef(OwnedNodeEdgePointRef newRef) {
+        ref = newRef;
         return this;
     }
 
+    public OwnedNodeEdgePointRef getNepRef() {
+        return ref;
+    }
+
     @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        EndPoint endPoint = (EndPoint) o;
-        return Objects.equals(endpoint, endPoint.endpoint) &&
-                Objects.equals(attrs, endPoint.attrs) &&
-                Objects.equals(systemNepUuid, endPoint.systemNepUuid);
+    public boolean equals(Object other) {
+        if (this == other) {
+            return true;
+        }
+        if (other == null || getClass() != other.getClass()) {
+            return false;
+        }
+        EndPoint endPoint = (EndPoint) other;
+        return Objects.equals(endpoint, endPoint.endpoint)
+                && Objects.equals(attrs, endPoint.attrs)
+                && Objects.equals(ref, endPoint.ref);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(endpoint, attrs, systemNepUuid);
+        return Objects.hash(endpoint, attrs, ref);
+    }
+
+    public void setLocalId(String localId) {
+        this.localId = localId;
+    }
+
+    public String getLocalId() {
+        return localId;
     }
 }