@Test public void testEquals() { final PortChain portChain1 = getPortChain(); final PortChain samePortChain1 = getPortChain(); final PortChainId portChainId2 = PortChainId.of("79999999-fc23-aeb6-f44b-56dc5e2fb3ae"); final TenantId tenantId2 = TenantId.tenantId("2"); final String name2 = "PortChain2"; final String description2 = "PortChain2"; final List<PortPairGroupId> portPairGroups2 = new LinkedList<PortPairGroupId>(); PortPairGroupId portPairGroupId = PortPairGroupId.of("75555555-fc23-aeb6-f44b-56dc5e2fb3ae"); portPairGroups2.add(portPairGroupId); portPairGroupId = PortPairGroupId.of("75555555-fc23-aeb6-f44b-56dc5e2fb3af"); portPairGroups2.add(portPairGroupId); final List<FlowClassifierId> flowClassifiers2 = new LinkedList<FlowClassifierId>(); FlowClassifierId flowClassifierId = FlowClassifierId.of("76666666-fc23-aeb6-f44b-56dc5e2fb3ae"); flowClassifiers2.add(flowClassifierId); flowClassifierId = FlowClassifierId.of("76666666-fc23-aeb6-f44b-56dc5e2fb3af"); flowClassifiers2.add(flowClassifierId); DefaultPortChain.Builder portChainBuilder = new DefaultPortChain.Builder(); final PortChain portChain2 = portChainBuilder.setId(portChainId2).setTenantId(tenantId2).setName(name2) .setDescription(description2).setPortPairGroups(portPairGroups2).setFlowClassifiers(flowClassifiers2) .build(); new EqualsTester().addEqualityGroup(portChain1, samePortChain1).addEqualityGroup(portChain2).testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPortChain) { DefaultPortChain that = (DefaultPortChain) obj; return Objects.equals(portChainId, that.portChainId) && Objects.equals(tenantId, that.tenantId) && Objects.equals(name, that.name) && Objects.equals(description, that.description) && Objects.equals(portPairGroupList, that.portPairGroupList) && Objects.equals(flowClassifierList, that.flowClassifierList); } return false; }
DefaultPortChain implements PortChain { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPortChain) { DefaultPortChain that = (DefaultPortChain) obj; return Objects.equals(portChainId, that.portChainId) && Objects.equals(tenantId, that.tenantId) && Objects.equals(name, that.name) && Objects.equals(description, that.description) && Objects.equals(portPairGroupList, that.portPairGroupList) && Objects.equals(flowClassifierList, that.flowClassifierList); } return false; } }
DefaultPortChain implements PortChain { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPortChain) { DefaultPortChain that = (DefaultPortChain) obj; return Objects.equals(portChainId, that.portChainId) && Objects.equals(tenantId, that.tenantId) && Objects.equals(name, that.name) && Objects.equals(description, that.description) && Objects.equals(portPairGroupList, that.portPairGroupList) && Objects.equals(flowClassifierList, that.flowClassifierList); } return false; } private  DefaultPortChain(PortChainId portChainId, TenantId tenantId,
            String name, String description,
            List<PortPairGroupId> portPairGroupList,
            List<FlowClassifierId> flowClassifierList,
            PortChain portChain); }
DefaultPortChain implements PortChain { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPortChain) { DefaultPortChain that = (DefaultPortChain) obj; return Objects.equals(portChainId, that.portChainId) && Objects.equals(tenantId, that.tenantId) && Objects.equals(name, that.name) && Objects.equals(description, that.description) && Objects.equals(portPairGroupList, that.portPairGroupList) && Objects.equals(flowClassifierList, that.flowClassifierList); } return false; } private  DefaultPortChain(PortChainId portChainId, TenantId tenantId,
            String name, String description,
            List<PortPairGroupId> portPairGroupList,
            List<FlowClassifierId> flowClassifierList,
            PortChain portChain); static PortChain create(PortChain newPortChain, PortChain oldPortChain); @Override PortChainId portChainId(); @Override TenantId tenantId(); @Override String name(); @Override String description(); @Override List<PortPairGroupId> portPairGroups(); @Override List<FlowClassifierId> flowClassifiers(); @Override PortChain oldPortChain(); @Override void addLoadBalancePath(FiveTuple fiveTuple, LoadBalanceId id,
                                   List<PortPairId> path); @Override void addSfcClassifiers(LoadBalanceId id, List<DeviceId> classifierList); @Override void addSfcForwarders(LoadBalanceId id, List<DeviceId> forwarderList); @Override void removeSfcClassifiers(LoadBalanceId id, List<DeviceId> classifierList); @Override void removeSfcForwarders(LoadBalanceId id, List<DeviceId> forwarderList); @Override List<DeviceId> getSfcClassifiers(LoadBalanceId id); @Override List<DeviceId> getSfcForwarders(LoadBalanceId id); @Override LoadBalanceId getLoadBalanceId(FiveTuple fiveTuple); @Override Set<FiveTuple> getLoadBalanceIdMapKeys(); @Override Set<LoadBalanceId> getLoadBalancePathMapKeys(); @Override List<PortPairId> getLoadBalancePath(LoadBalanceId id); @Override List<PortPairId> getLoadBalancePath(FiveTuple fiveTuple); @Override int getLoadBalancePathSize(); @Override LoadBalanceId matchPath(List<PortPairId> path); @Override int hashCode(); @Override boolean equals(Object obj); @Override boolean exactMatch(PortChain portChain); @Override String toString(); static Builder builder(); }
DefaultPortChain implements PortChain { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPortChain) { DefaultPortChain that = (DefaultPortChain) obj; return Objects.equals(portChainId, that.portChainId) && Objects.equals(tenantId, that.tenantId) && Objects.equals(name, that.name) && Objects.equals(description, that.description) && Objects.equals(portPairGroupList, that.portPairGroupList) && Objects.equals(flowClassifierList, that.flowClassifierList); } return false; } private  DefaultPortChain(PortChainId portChainId, TenantId tenantId,
            String name, String description,
            List<PortPairGroupId> portPairGroupList,
            List<FlowClassifierId> flowClassifierList,
            PortChain portChain); static PortChain create(PortChain newPortChain, PortChain oldPortChain); @Override PortChainId portChainId(); @Override TenantId tenantId(); @Override String name(); @Override String description(); @Override List<PortPairGroupId> portPairGroups(); @Override List<FlowClassifierId> flowClassifiers(); @Override PortChain oldPortChain(); @Override void addLoadBalancePath(FiveTuple fiveTuple, LoadBalanceId id,
                                   List<PortPairId> path); @Override void addSfcClassifiers(LoadBalanceId id, List<DeviceId> classifierList); @Override void addSfcForwarders(LoadBalanceId id, List<DeviceId> forwarderList); @Override void removeSfcClassifiers(LoadBalanceId id, List<DeviceId> classifierList); @Override void removeSfcForwarders(LoadBalanceId id, List<DeviceId> forwarderList); @Override List<DeviceId> getSfcClassifiers(LoadBalanceId id); @Override List<DeviceId> getSfcForwarders(LoadBalanceId id); @Override LoadBalanceId getLoadBalanceId(FiveTuple fiveTuple); @Override Set<FiveTuple> getLoadBalanceIdMapKeys(); @Override Set<LoadBalanceId> getLoadBalancePathMapKeys(); @Override List<PortPairId> getLoadBalancePath(LoadBalanceId id); @Override List<PortPairId> getLoadBalancePath(FiveTuple fiveTuple); @Override int getLoadBalancePathSize(); @Override LoadBalanceId matchPath(List<PortPairId> path); @Override int hashCode(); @Override boolean equals(Object obj); @Override boolean exactMatch(PortChain portChain); @Override String toString(); static Builder builder();  }