@Test public void testEquals() { final String cost1 = "1"; final String bandwidth1 = "200"; final String src1 = "foo"; final String dst1 = "bee"; final String type1 = "1"; final String name1 = "pcc"; PcePath path1 = DefaultPcePath.builder() .source(src1) .destination(dst1) .lspType(type1) .name(name1) .costConstraint(cost1) .bandwidthConstraint(bandwidth1) .build(); path1.id(TunnelId.valueOf("1")); PcePath samePath1 = DefaultPcePath.builder() .source(src1) .destination(dst1) .lspType(type1) .name(name1) .costConstraint(cost1) .bandwidthConstraint(bandwidth1) .build(); samePath1.id(TunnelId.valueOf("1")); final String cost2 = "1"; final String bandwidth2 = "200"; final String src2 = "google"; final String dst2 = "yahoo"; final String type2 = "2"; final String name2 = "pcc2"; PcePath path2 = DefaultPcePath.builder() .source(src2) .destination(dst2) .lspType(type2) .name(name2) .costConstraint(cost2) .bandwidthConstraint(bandwidth2) .build(); path2.id(TunnelId.valueOf("2")); new EqualsTester().addEqualityGroup(path1, samePath1).addEqualityGroup(path2).testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPcePath) { DefaultPcePath that = (DefaultPcePath) obj; return Objects.equals(id, that.id) && Objects.equals(source, that.source) && Objects.equals(destination, that.destination) && Objects.equals(lspType, that.lspType) && Objects.equals(name, that.name) && Objects.equals(costConstraint, that.costConstraint) && Objects.equals(bandwidthConstraint, that.bandwidthConstraint); } return false; }
DefaultPcePath implements PcePath { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPcePath) { DefaultPcePath that = (DefaultPcePath) obj; return Objects.equals(id, that.id) && Objects.equals(source, that.source) && Objects.equals(destination, that.destination) && Objects.equals(lspType, that.lspType) && Objects.equals(name, that.name) && Objects.equals(costConstraint, that.costConstraint) && Objects.equals(bandwidthConstraint, that.bandwidthConstraint); } return false; } }
DefaultPcePath implements PcePath { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPcePath) { DefaultPcePath that = (DefaultPcePath) obj; return Objects.equals(id, that.id) && Objects.equals(source, that.source) && Objects.equals(destination, that.destination) && Objects.equals(lspType, that.lspType) && Objects.equals(name, that.name) && Objects.equals(costConstraint, that.costConstraint) && Objects.equals(bandwidthConstraint, that.bandwidthConstraint); } return false; } private  DefaultPcePath(TunnelId id, String src, String dst, LspType lspType,
                           String name, Constraint costConstrnt, Constraint bandwidthConstrnt); }
DefaultPcePath implements PcePath { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPcePath) { DefaultPcePath that = (DefaultPcePath) obj; return Objects.equals(id, that.id) && Objects.equals(source, that.source) && Objects.equals(destination, that.destination) && Objects.equals(lspType, that.lspType) && Objects.equals(name, that.name) && Objects.equals(costConstraint, that.costConstraint) && Objects.equals(bandwidthConstraint, that.bandwidthConstraint); } return false; } private  DefaultPcePath(TunnelId id, String src, String dst, LspType lspType,
                           String name, Constraint costConstrnt, Constraint bandwidthConstrnt); @Override TunnelId id(); @Override void id(TunnelId id); @Override String source(); @Override void source(String src); @Override String destination(); @Override void destination(String dst); @Override LspType lspType(); @Override String name(); @Override Constraint costConstraint(); @Override Constraint bandwidthConstraint(); @Override PcePath copy(PcePath path); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static Builder builder(); }
DefaultPcePath implements PcePath { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPcePath) { DefaultPcePath that = (DefaultPcePath) obj; return Objects.equals(id, that.id) && Objects.equals(source, that.source) && Objects.equals(destination, that.destination) && Objects.equals(lspType, that.lspType) && Objects.equals(name, that.name) && Objects.equals(costConstraint, that.costConstraint) && Objects.equals(bandwidthConstraint, that.bandwidthConstraint); } return false; } private  DefaultPcePath(TunnelId id, String src, String dst, LspType lspType,
                           String name, Constraint costConstrnt, Constraint bandwidthConstrnt); @Override TunnelId id(); @Override void id(TunnelId id); @Override String source(); @Override void source(String src); @Override String destination(); @Override void destination(String dst); @Override LspType lspType(); @Override String name(); @Override Constraint costConstraint(); @Override Constraint bandwidthConstraint(); @Override PcePath copy(PcePath path); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static Builder builder();  }