@Test public void testEquals() { final PortPairGroup portPairGroup1 = getPortPairGroup(); DefaultPortPairGroup.Builder portPairGroupBuilder = new DefaultPortPairGroup.Builder(); final PortPairGroup samePortPairGroup1 = getPortPairGroup(); final PortPairGroupId portPairGroupId2 = PortPairGroupId.of("79999999-fc23-aeb6-f44b-56dc5e2fb3ae"); final TenantId tenantId2 = TenantId.tenantId("2"); final String name2 = "PortPairGroup2"; final String description2 = "PortPairGroup2"; final List<PortPairId> portPairList2 = new LinkedList<PortPairId>(); PortPairId portPairId = PortPairId.of("75555555-fc23-aeb6-f44b-56dc5e2fb3ae"); portPairList2.add(portPairId); portPairId = PortPairId.of("75555555-fc23-aeb6-f44b-56dc5e2fb3ae"); portPairList2.add(portPairId); portPairGroupBuilder = new DefaultPortPairGroup.Builder(); final PortPairGroup portPairGroup2 = portPairGroupBuilder.setId(portPairGroupId2).setTenantId(tenantId2) .setName(name2).setDescription(description2).setPortPairs(portPairList2).build(); new EqualsTester().addEqualityGroup(portPairGroup1, samePortPairGroup1).addEqualityGroup(portPairGroup2) .testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPortPairGroup) { DefaultPortPairGroup that = (DefaultPortPairGroup) obj; return Objects.equals(portPairGroupId, that.portPairGroupId) && Objects.equals(tenantId, that.tenantId) && Objects.equals(name, that.name) && Objects.equals(description, that.description) && Objects.equals(portPairList, that.portPairList); } return false; }
DefaultPortPairGroup implements PortPairGroup { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPortPairGroup) { DefaultPortPairGroup that = (DefaultPortPairGroup) obj; return Objects.equals(portPairGroupId, that.portPairGroupId) && Objects.equals(tenantId, that.tenantId) && Objects.equals(name, that.name) && Objects.equals(description, that.description) && Objects.equals(portPairList, that.portPairList); } return false; } }
DefaultPortPairGroup implements PortPairGroup { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPortPairGroup) { DefaultPortPairGroup that = (DefaultPortPairGroup) obj; return Objects.equals(portPairGroupId, that.portPairGroupId) && Objects.equals(tenantId, that.tenantId) && Objects.equals(name, that.name) && Objects.equals(description, that.description) && Objects.equals(portPairList, that.portPairList); } return false; } private  DefaultPortPairGroup(PortPairGroupId portPairGroupId, TenantId tenantId,
                                 String name, String description,
                                 List<PortPairId> portPairList); }
DefaultPortPairGroup implements PortPairGroup { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPortPairGroup) { DefaultPortPairGroup that = (DefaultPortPairGroup) obj; return Objects.equals(portPairGroupId, that.portPairGroupId) && Objects.equals(tenantId, that.tenantId) && Objects.equals(name, that.name) && Objects.equals(description, that.description) && Objects.equals(portPairList, that.portPairList); } return false; } private  DefaultPortPairGroup(PortPairGroupId portPairGroupId, TenantId tenantId,
                                 String name, String description,
                                 List<PortPairId> portPairList); @Override PortPairGroupId portPairGroupId(); @Override TenantId tenantId(); @Override String name(); @Override String description(); @Override List<PortPairId> portPairs(); @Override void addLoad(PortPairId portPairId); @Override void resetLoad(); @Override int getLoad(PortPairId portPairId); @Override Map<PortPairId, Integer> portPairLoadMap(); @Override int hashCode(); @Override boolean equals(Object obj); @Override boolean exactMatch(PortPairGroup portPairGroup); @Override String toString(); static Builder builder(); }
DefaultPortPairGroup implements PortPairGroup { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultPortPairGroup) { DefaultPortPairGroup that = (DefaultPortPairGroup) obj; return Objects.equals(portPairGroupId, that.portPairGroupId) && Objects.equals(tenantId, that.tenantId) && Objects.equals(name, that.name) && Objects.equals(description, that.description) && Objects.equals(portPairList, that.portPairList); } return false; } private  DefaultPortPairGroup(PortPairGroupId portPairGroupId, TenantId tenantId,
                                 String name, String description,
                                 List<PortPairId> portPairList); @Override PortPairGroupId portPairGroupId(); @Override TenantId tenantId(); @Override String name(); @Override String description(); @Override List<PortPairId> portPairs(); @Override void addLoad(PortPairId portPairId); @Override void resetLoad(); @Override int getLoad(PortPairId portPairId); @Override Map<PortPairId, Integer> portPairLoadMap(); @Override int hashCode(); @Override boolean equals(Object obj); @Override boolean exactMatch(PortPairGroup portPairGroup); @Override String toString(); static Builder builder();  }