@Test public void testEquals() { initVirtualPortId(); initFixedIpSet(); initPropertyMap(); initAddressPairSet(); initSecurityGroupSet(); TenantNetworkId networkId = TenantNetworkId.networkId(tenantNetworkId); MacAddress macAddress = MacAddress.valueOf(macAddressStr); TenantId tenantId = TenantId.tenantId(tenantIdStr); DeviceId deviceId = DeviceId.deviceId(deviceStr); BindingHostId bindingHostId = BindingHostId.bindingHostId(hostIdStr); VirtualPort d1 = new DefaultVirtualPort(id1, networkId, true, propertyMap, VirtualPort.State.ACTIVE, macAddress, tenantId, deviceId, fixedIps, bindingHostId, allowedAddressPairs, securityGroups); VirtualPort d2 = new DefaultVirtualPort(id1, networkId, true, propertyMap, VirtualPort.State.ACTIVE, macAddress, tenantId, deviceId, fixedIps, bindingHostId, allowedAddressPairs, securityGroups); VirtualPort d3 = new DefaultVirtualPort(id2, networkId, true, propertyMap, VirtualPort.State.ACTIVE, macAddress, tenantId, deviceId, fixedIps, bindingHostId, allowedAddressPairs, securityGroups); new EqualsTester().addEqualityGroup(d1, d2).addEqualityGroup(d3) .testEquals(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultVirtualPort) { final DefaultVirtualPort that = (DefaultVirtualPort) obj; return Objects.equals(this.id, that.id) && Objects.equals(this.networkId, that.networkId) && Objects.equals(this.adminStateUp, that.adminStateUp) && Objects.equals(this.state, that.state) && Objects.equals(this.name, that.name) && Objects.equals(this.tenantId, that.tenantId) && Objects.equals(this.macAddress, that.macAddress) && Objects.equals(this.deviceId, that.deviceId) && Objects.equals(this.deviceOwner, that.deviceOwner) && Objects.equals(this.allowedAddressPairs, that.allowedAddressPairs) && Objects.equals(this.fixedIps, that.fixedIps) && Objects.equals(this.bindingHostId, that.bindingHostId) && Objects.equals(this.bindingVifDetails, that.bindingVifDetails) && Objects.equals(this.bindingVifType, that.bindingVifType) && Objects.equals(this.bindingVnicType, that.bindingVnicType) && Objects.equals(this.securityGroups, that.securityGroups); } return false; }
DefaultVirtualPort implements VirtualPort { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultVirtualPort) { final DefaultVirtualPort that = (DefaultVirtualPort) obj; return Objects.equals(this.id, that.id) && Objects.equals(this.networkId, that.networkId) && Objects.equals(this.adminStateUp, that.adminStateUp) && Objects.equals(this.state, that.state) && Objects.equals(this.name, that.name) && Objects.equals(this.tenantId, that.tenantId) && Objects.equals(this.macAddress, that.macAddress) && Objects.equals(this.deviceId, that.deviceId) && Objects.equals(this.deviceOwner, that.deviceOwner) && Objects.equals(this.allowedAddressPairs, that.allowedAddressPairs) && Objects.equals(this.fixedIps, that.fixedIps) && Objects.equals(this.bindingHostId, that.bindingHostId) && Objects.equals(this.bindingVifDetails, that.bindingVifDetails) && Objects.equals(this.bindingVifType, that.bindingVifType) && Objects.equals(this.bindingVnicType, that.bindingVnicType) && Objects.equals(this.securityGroups, that.securityGroups); } return false; } }
DefaultVirtualPort implements VirtualPort { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultVirtualPort) { final DefaultVirtualPort that = (DefaultVirtualPort) obj; return Objects.equals(this.id, that.id) && Objects.equals(this.networkId, that.networkId) && Objects.equals(this.adminStateUp, that.adminStateUp) && Objects.equals(this.state, that.state) && Objects.equals(this.name, that.name) && Objects.equals(this.tenantId, that.tenantId) && Objects.equals(this.macAddress, that.macAddress) && Objects.equals(this.deviceId, that.deviceId) && Objects.equals(this.deviceOwner, that.deviceOwner) && Objects.equals(this.allowedAddressPairs, that.allowedAddressPairs) && Objects.equals(this.fixedIps, that.fixedIps) && Objects.equals(this.bindingHostId, that.bindingHostId) && Objects.equals(this.bindingVifDetails, that.bindingVifDetails) && Objects.equals(this.bindingVifType, that.bindingVifType) && Objects.equals(this.bindingVnicType, that.bindingVnicType) && Objects.equals(this.securityGroups, that.securityGroups); } return false; } DefaultVirtualPort(VirtualPortId id,
                              TenantNetworkId networkId,
                              Boolean adminStateUp,
                              Map<String, String> strMap,
                              State state,
                              MacAddress macAddress,
                              TenantId tenantId,
                              DeviceId deviceId,
                              Set<FixedIp> fixedIps,
                              BindingHostId bindingHostId,
                              Set<AllowedAddressPair> allowedAddressPairs,
                              Set<SecurityGroup> securityGroups); }
DefaultVirtualPort implements VirtualPort { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultVirtualPort) { final DefaultVirtualPort that = (DefaultVirtualPort) obj; return Objects.equals(this.id, that.id) && Objects.equals(this.networkId, that.networkId) && Objects.equals(this.adminStateUp, that.adminStateUp) && Objects.equals(this.state, that.state) && Objects.equals(this.name, that.name) && Objects.equals(this.tenantId, that.tenantId) && Objects.equals(this.macAddress, that.macAddress) && Objects.equals(this.deviceId, that.deviceId) && Objects.equals(this.deviceOwner, that.deviceOwner) && Objects.equals(this.allowedAddressPairs, that.allowedAddressPairs) && Objects.equals(this.fixedIps, that.fixedIps) && Objects.equals(this.bindingHostId, that.bindingHostId) && Objects.equals(this.bindingVifDetails, that.bindingVifDetails) && Objects.equals(this.bindingVifType, that.bindingVifType) && Objects.equals(this.bindingVnicType, that.bindingVnicType) && Objects.equals(this.securityGroups, that.securityGroups); } return false; } DefaultVirtualPort(VirtualPortId id,
                              TenantNetworkId networkId,
                              Boolean adminStateUp,
                              Map<String, String> strMap,
                              State state,
                              MacAddress macAddress,
                              TenantId tenantId,
                              DeviceId deviceId,
                              Set<FixedIp> fixedIps,
                              BindingHostId bindingHostId,
                              Set<AllowedAddressPair> allowedAddressPairs,
                              Set<SecurityGroup> securityGroups); @Override VirtualPortId portId(); @Override TenantNetworkId networkId(); @Override String name(); @Override boolean adminStateUp(); @Override State state(); @Override MacAddress macAddress(); @Override TenantId tenantId(); @Override DeviceId deviceId(); @Override String deviceOwner(); @Override Collection<AllowedAddressPair> allowedAddressPairs(); @Override Set<FixedIp> fixedIps(); @Override BindingHostId bindingHostId(); @Override String bindingVnicType(); @Override String bindingVifType(); @Override String bindingVifDetails(); @Override Collection<SecurityGroup> securityGroups(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
DefaultVirtualPort implements VirtualPort { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DefaultVirtualPort) { final DefaultVirtualPort that = (DefaultVirtualPort) obj; return Objects.equals(this.id, that.id) && Objects.equals(this.networkId, that.networkId) && Objects.equals(this.adminStateUp, that.adminStateUp) && Objects.equals(this.state, that.state) && Objects.equals(this.name, that.name) && Objects.equals(this.tenantId, that.tenantId) && Objects.equals(this.macAddress, that.macAddress) && Objects.equals(this.deviceId, that.deviceId) && Objects.equals(this.deviceOwner, that.deviceOwner) && Objects.equals(this.allowedAddressPairs, that.allowedAddressPairs) && Objects.equals(this.fixedIps, that.fixedIps) && Objects.equals(this.bindingHostId, that.bindingHostId) && Objects.equals(this.bindingVifDetails, that.bindingVifDetails) && Objects.equals(this.bindingVifType, that.bindingVifType) && Objects.equals(this.bindingVnicType, that.bindingVnicType) && Objects.equals(this.securityGroups, that.securityGroups); } return false; } DefaultVirtualPort(VirtualPortId id,
                              TenantNetworkId networkId,
                              Boolean adminStateUp,
                              Map<String, String> strMap,
                              State state,
                              MacAddress macAddress,
                              TenantId tenantId,
                              DeviceId deviceId,
                              Set<FixedIp> fixedIps,
                              BindingHostId bindingHostId,
                              Set<AllowedAddressPair> allowedAddressPairs,
                              Set<SecurityGroup> securityGroups); @Override VirtualPortId portId(); @Override TenantNetworkId networkId(); @Override String name(); @Override boolean adminStateUp(); @Override State state(); @Override MacAddress macAddress(); @Override TenantId tenantId(); @Override DeviceId deviceId(); @Override String deviceOwner(); @Override Collection<AllowedAddressPair> allowedAddressPairs(); @Override Set<FixedIp> fixedIps(); @Override BindingHostId bindingHostId(); @Override String bindingVnicType(); @Override String bindingVifType(); @Override String bindingVifDetails(); @Override Collection<SecurityGroup> securityGroups(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }