@Test public void testEquals() { DeviceId src1 = DeviceId.deviceId("foo1"); DeviceId dst1 = DeviceId.deviceId("goo1"); String name1 = "pcc1"; LspType lspType1 = LspType.WITH_SIGNALLING; List<Constraint> constraints1 = new LinkedList<>(); Constraint bandwidth11 = BandwidthConstraint.of(100, DataRateUnit.BPS); constraints1.add(bandwidth11); Constraint bandwidth12 = BandwidthConstraint.of(200, DataRateUnit.BPS); constraints1.add(bandwidth12); Constraint bandwidth13 = BandwidthConstraint.of(300, DataRateUnit.BPS); constraints1.add(bandwidth13); PcePathInfo pathInfo1 = new PcePathInfo(src1, dst1, name1, constraints1, lspType1); PcePathInfo samePathInfo1 = new PcePathInfo(src1, dst1, name1, constraints1, lspType1); DeviceId src2 = DeviceId.deviceId("foo2"); DeviceId dst2 = DeviceId.deviceId("goo2"); String name2 = "pcc2"; LspType lspType2 = LspType.SR_WITHOUT_SIGNALLING; List<Constraint> constraints2 = new LinkedList<>(); Constraint bandwidth21 = BandwidthConstraint.of(400, DataRateUnit.BPS); constraints2.add(bandwidth21); Constraint bandwidth22 = BandwidthConstraint.of(800, DataRateUnit.BPS); constraints2.add(bandwidth22); PcePathInfo pathInfo2 = new PcePathInfo(src2, dst2, name2, constraints2, lspType2); new EqualsTester().addEqualityGroup(pathInfo1, samePathInfo1) .addEqualityGroup(pathInfo2) .testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof PcePathInfo) { final PcePathInfo other = (PcePathInfo) obj; return Objects.equals(this.src, other.src) && Objects.equals(this.dst, other.dst) && Objects.equals(this.name, other.name) && Objects.equals(this.constraints, other.constraints) && Objects.equals(this.lspType, other.lspType); } return false; }
PcePathInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof PcePathInfo) { final PcePathInfo other = (PcePathInfo) obj; return Objects.equals(this.src, other.src) && Objects.equals(this.dst, other.dst) && Objects.equals(this.name, other.name) && Objects.equals(this.constraints, other.constraints) && Objects.equals(this.lspType, other.lspType); } return false; } }
PcePathInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof PcePathInfo) { final PcePathInfo other = (PcePathInfo) obj; return Objects.equals(this.src, other.src) && Objects.equals(this.dst, other.dst) && Objects.equals(this.name, other.name) && Objects.equals(this.constraints, other.constraints) && Objects.equals(this.lspType, other.lspType); } return false; } PcePathInfo(DeviceId src,
                    DeviceId dst,
                    String name,
                    List<Constraint> constraints,
                    LspType lspType);  PcePathInfo(); }
PcePathInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof PcePathInfo) { final PcePathInfo other = (PcePathInfo) obj; return Objects.equals(this.src, other.src) && Objects.equals(this.dst, other.dst) && Objects.equals(this.name, other.name) && Objects.equals(this.constraints, other.constraints) && Objects.equals(this.lspType, other.lspType); } return false; } PcePathInfo(DeviceId src,
                    DeviceId dst,
                    String name,
                    List<Constraint> constraints,
                    LspType lspType);  PcePathInfo(); DeviceId src(); void src(DeviceId id); DeviceId dst(); void dst(DeviceId id); String name(); void name(String name); List<Constraint> constraints(); void constraints(List<Constraint> constraints); LspType lspType(); void lspType(LspType lspType); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
PcePathInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof PcePathInfo) { final PcePathInfo other = (PcePathInfo) obj; return Objects.equals(this.src, other.src) && Objects.equals(this.dst, other.dst) && Objects.equals(this.name, other.name) && Objects.equals(this.constraints, other.constraints) && Objects.equals(this.lspType, other.lspType); } return false; } PcePathInfo(DeviceId src,
                    DeviceId dst,
                    String name,
                    List<Constraint> constraints,
                    LspType lspType);  PcePathInfo(); DeviceId src(); void src(DeviceId id); DeviceId dst(); void dst(DeviceId id); String name(); void name(String name); List<Constraint> constraints(); void constraints(List<Constraint> constraints); LspType lspType(); void lspType(LspType lspType); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }