@Test public void testEquals() { List<LspLocalLabelInfo> lspLocalLabelList1 = new LinkedList<>(); ResourceConsumer tunnelConsumerId1 = TunnelConsumerId.valueOf(10); DeviceId deviceId1 = DeviceId.deviceId("foo"); LabelResourceId inLabelId1 = LabelResourceId.labelResourceId(1); LabelResourceId outLabelId1 = LabelResourceId.labelResourceId(2); PortNumber inPort1 = PortNumber.portNumber(5122); PortNumber outPort1 = PortNumber.portNumber(5123); LspLocalLabelInfo lspLocalLabel1 = DefaultLspLocalLabelInfo.builder() .deviceId(deviceId1) .inLabelId(inLabelId1) .outLabelId(outLabelId1) .inPort(inPort1) .outPort(outPort1) .build(); lspLocalLabelList1.add(lspLocalLabel1); PceccTunnelInfo pceccTunnelInfo1 = new PceccTunnelInfo(lspLocalLabelList1, tunnelConsumerId1); PceccTunnelInfo samePceccTunnelInfo1 = new PceccTunnelInfo(lspLocalLabelList1, tunnelConsumerId1); List<LspLocalLabelInfo> lspLocalLabelInfoList2 = new LinkedList<>(); ResourceConsumer tunnelConsumerId2 = TunnelConsumerId.valueOf(20); DeviceId deviceId2 = DeviceId.deviceId("goo"); LabelResourceId inLabelId2 = LabelResourceId.labelResourceId(3); LabelResourceId outLabelId2 = LabelResourceId.labelResourceId(4); PortNumber inPort2 = PortNumber.portNumber(5124); PortNumber outPort2 = PortNumber.portNumber(5125); LspLocalLabelInfo lspLocalLabel2 = DefaultLspLocalLabelInfo.builder() .deviceId(deviceId2) .inLabelId(inLabelId2) .outLabelId(outLabelId2) .inPort(inPort2) .outPort(outPort2) .build(); lspLocalLabelInfoList2.add(lspLocalLabel2); PceccTunnelInfo pceccTunnelInfo2 = new PceccTunnelInfo(lspLocalLabelInfoList2, tunnelConsumerId2); new EqualsTester().addEqualityGroup(pceccTunnelInfo1, samePceccTunnelInfo1) .addEqualityGroup(pceccTunnelInfo2) .testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof PceccTunnelInfo) { final PceccTunnelInfo other = (PceccTunnelInfo) obj; return Objects.equals(this.lspLocalLabelInfoList, other.lspLocalLabelInfoList) && Objects.equals(this.tunnelConsumerId, other.tunnelConsumerId); } return false; }
PceccTunnelInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof PceccTunnelInfo) { final PceccTunnelInfo other = (PceccTunnelInfo) obj; return Objects.equals(this.lspLocalLabelInfoList, other.lspLocalLabelInfoList) && Objects.equals(this.tunnelConsumerId, other.tunnelConsumerId); } return false; } }
PceccTunnelInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof PceccTunnelInfo) { final PceccTunnelInfo other = (PceccTunnelInfo) obj; return Objects.equals(this.lspLocalLabelInfoList, other.lspLocalLabelInfoList) && Objects.equals(this.tunnelConsumerId, other.tunnelConsumerId); } return false; } PceccTunnelInfo(List<LspLocalLabelInfo> lspLocalLabelInfoList,
                                           ResourceConsumer tunnelConsumerId);  PceccTunnelInfo(); }
PceccTunnelInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof PceccTunnelInfo) { final PceccTunnelInfo other = (PceccTunnelInfo) obj; return Objects.equals(this.lspLocalLabelInfoList, other.lspLocalLabelInfoList) && Objects.equals(this.tunnelConsumerId, other.tunnelConsumerId); } return false; } PceccTunnelInfo(List<LspLocalLabelInfo> lspLocalLabelInfoList,
                                           ResourceConsumer tunnelConsumerId);  PceccTunnelInfo(); List<LspLocalLabelInfo> lspLocalLabelInfoList(); ResourceConsumer tunnelConsumerId(); void lspLocalLabelInfoList(List<LspLocalLabelInfo> lspLocalLabelInfoList); void tunnelConsumerId(ResourceConsumer id); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
PceccTunnelInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof PceccTunnelInfo) { final PceccTunnelInfo other = (PceccTunnelInfo) obj; return Objects.equals(this.lspLocalLabelInfoList, other.lspLocalLabelInfoList) && Objects.equals(this.tunnelConsumerId, other.tunnelConsumerId); } return false; } PceccTunnelInfo(List<LspLocalLabelInfo> lspLocalLabelInfoList,
                                           ResourceConsumer tunnelConsumerId);  PceccTunnelInfo(); List<LspLocalLabelInfo> lspLocalLabelInfoList(); ResourceConsumer tunnelConsumerId(); void lspLocalLabelInfoList(List<LspLocalLabelInfo> lspLocalLabelInfoList); void tunnelConsumerId(ResourceConsumer id); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }