1 package org.onap.ccsdk.sli.core.slipluginutils.slitopologyutils.topology;
3 import java.util.Objects;
5 public class OtnLink implements Link{
7 private final Type type = Type.OTN;
8 private final PInterface src;
9 private final PInterface dst;
12 private final String linkName;
14 public OtnLink(String linkName, PInterface src, PInterface dst){
15 this.linkName = linkName;
20 public PInterface src() {
24 public PInterface dst() {
28 public String linkName() {
32 public boolean isInnerDomain(){
33 if (src != null && dst != null){
34 if (src.pInterfaceName() != null && dst.pInterfaceName() != null){
35 if (src.pInterfaceName().getNetworkId() != null
36 && dst.pInterfaceName().getNetworkId() != null) {
37 return src.pInterfaceName().getNetworkId().equals(dst.pInterfaceName().getNetworkId());
45 public boolean equals(Object o){
49 if (o instanceof OtnLink){
50 final OtnLink other = (OtnLink) o;
51 return Objects.equals(this.linkName, other.linkName);
57 public int hashCode(){
58 return Objects.hash(linkName, type, src, dst);