@Test public void testEquals() { 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(); LspLocalLabelInfo sameLocalLabel1 = DefaultLspLocalLabelInfo.builder() .deviceId(deviceId1) .inLabelId(inLabelId1) .outLabelId(outLabelId1) .inPort(inPort1) .outPort(outPort1) .build(); 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(); new EqualsTester().addEqualityGroup(lspLocalLabel1, sameLocalLabel1) .addEqualityGroup(lspLocalLabel2) .testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof LspLocalLabelInfo) { final DefaultLspLocalLabelInfo other = (DefaultLspLocalLabelInfo) obj; return Objects.equals(this.deviceId, other.deviceId) && Objects.equals(this.inLabelId, other.inLabelId) && Objects.equals(this.outLabelId, other.outLabelId) && Objects.equals(this.inPort, other.inPort) && Objects.equals(this.outPort, other.outPort); } return false; }
DefaultLspLocalLabelInfo implements LspLocalLabelInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof LspLocalLabelInfo) { final DefaultLspLocalLabelInfo other = (DefaultLspLocalLabelInfo) obj; return Objects.equals(this.deviceId, other.deviceId) && Objects.equals(this.inLabelId, other.inLabelId) && Objects.equals(this.outLabelId, other.outLabelId) && Objects.equals(this.inPort, other.inPort) && Objects.equals(this.outPort, other.outPort); } return false; } }
DefaultLspLocalLabelInfo implements LspLocalLabelInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof LspLocalLabelInfo) { final DefaultLspLocalLabelInfo other = (DefaultLspLocalLabelInfo) obj; return Objects.equals(this.deviceId, other.deviceId) && Objects.equals(this.inLabelId, other.inLabelId) && Objects.equals(this.outLabelId, other.outLabelId) && Objects.equals(this.inPort, other.inPort) && Objects.equals(this.outPort, other.outPort); } return false; } private  DefaultLspLocalLabelInfo(DeviceId deviceId,
                                     LabelResourceId inLabelId,
                                     LabelResourceId outLabelId,
                                     PortNumber inPort,
                                     PortNumber outPort); private  DefaultLspLocalLabelInfo(); }
DefaultLspLocalLabelInfo implements LspLocalLabelInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof LspLocalLabelInfo) { final DefaultLspLocalLabelInfo other = (DefaultLspLocalLabelInfo) obj; return Objects.equals(this.deviceId, other.deviceId) && Objects.equals(this.inLabelId, other.inLabelId) && Objects.equals(this.outLabelId, other.outLabelId) && Objects.equals(this.inPort, other.inPort) && Objects.equals(this.outPort, other.outPort); } return false; } private  DefaultLspLocalLabelInfo(DeviceId deviceId,
                                     LabelResourceId inLabelId,
                                     LabelResourceId outLabelId,
                                     PortNumber inPort,
                                     PortNumber outPort); private  DefaultLspLocalLabelInfo(); @Override DeviceId deviceId(); @Override LabelResourceId inLabelId(); @Override LabelResourceId outLabelId(); @Override PortNumber inPort(); @Override PortNumber outPort(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static Builder builder(LspLocalLabelInfo deviceLabelInfo); static Builder builder(); }
DefaultLspLocalLabelInfo implements LspLocalLabelInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof LspLocalLabelInfo) { final DefaultLspLocalLabelInfo other = (DefaultLspLocalLabelInfo) obj; return Objects.equals(this.deviceId, other.deviceId) && Objects.equals(this.inLabelId, other.inLabelId) && Objects.equals(this.outLabelId, other.outLabelId) && Objects.equals(this.inPort, other.inPort) && Objects.equals(this.outPort, other.outPort); } return false; } private  DefaultLspLocalLabelInfo(DeviceId deviceId,
                                     LabelResourceId inLabelId,
                                     LabelResourceId outLabelId,
                                     PortNumber inPort,
                                     PortNumber outPort); private  DefaultLspLocalLabelInfo(); @Override DeviceId deviceId(); @Override LabelResourceId inLabelId(); @Override LabelResourceId outLabelId(); @Override PortNumber inPort(); @Override PortNumber outPort(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static Builder builder(LspLocalLabelInfo deviceLabelInfo); static Builder builder();  }