Refactoring hashcodes/equals.

This commit is contained in:
Andrew Bayer 2012-05-18 11:39:09 -07:00
parent 49956b5d15
commit 4a1e7e0005
49 changed files with 927 additions and 2200 deletions

View File

@ -27,6 +27,7 @@ import javax.annotation.Nullable;
import com.google.common.base.CaseFormat;
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.collect.ForwardingSet;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
@ -637,12 +638,7 @@ public class Account extends ForwardingSet<User> implements Comparable<Account>
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (domainId ^ (domainId >>> 32));
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
return Objects.hashCode(domainId, id, name);
}
@Override
@ -653,16 +649,11 @@ public class Account extends ForwardingSet<User> implements Comparable<Account>
return false;
if (getClass() != obj.getClass())
return false;
Account other = (Account) obj;
if (domainId != other.domainId)
return false;
if (id != other.id)
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
Account that = (Account) obj;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(name, that.name)) return false;
return true;
}

View File

@ -18,6 +18,8 @@
*/
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import java.util.Date;
/**
@ -99,23 +101,19 @@ public class Alert implements Comparable<Alert> {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Alert alert = (Alert) o;
Alert that = (Alert) o;
if (id != alert.id) return false;
if (description != null ? !description.equals(alert.description) : alert.description != null) return false;
if (sent != null ? !sent.equals(alert.sent) : alert.sent != null) return false;
if (type != null ? !type.equals(alert.type) : alert.type != null) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(description, that.description)) return false;
if (!Objects.equal(sent, that.sent)) return false;
if (!Objects.equal(type, that.type)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (description != null ? description.hashCode() : 0);
result = 31 * result + (sent != null ? sent.hashCode() : 0);
result = 31 * result + (type != null ? type.hashCode() : 0);
return result;
return Objects.hashCode(id, description, sent, type);
}

View File

@ -19,6 +19,7 @@
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -81,19 +82,15 @@ public class ApiKeyPair implements Comparable<ApiKeyPair> {
ApiKeyPair that = (ApiKeyPair) o;
if (apiKey != null ? !apiKey.equals(that.apiKey) : that.apiKey != null)
return false;
if (secretKey != null ? !secretKey.equals(that.secretKey) : that.secretKey != null)
return false;
if (!Objects.equal(apiKey, that.apiKey)) return false;
if (!Objects.equal(secretKey, that.secretKey)) return false;
return true;
}
@Override
public int hashCode() {
int result = apiKey != null ? apiKey.hashCode() : 0;
result = 31 * result + (secretKey != null ? secretKey.hashCode() : 0);
return result;
return Objects.hashCode(apiKey, secretKey);
}
@Override

View File

@ -18,6 +18,7 @@
*/
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -60,11 +61,7 @@ public class AsyncCreateResponse {
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + (int) (jobId ^ (jobId >>> 32));
return result;
return Objects.hashCode(id, jobId);
}
@Override
@ -75,11 +72,11 @@ public class AsyncCreateResponse {
return false;
if (getClass() != obj.getClass())
return false;
AsyncCreateResponse other = (AsyncCreateResponse) obj;
if (id != other.id)
return false;
if (jobId != other.jobId)
return false;
AsyncCreateResponse that = (AsyncCreateResponse) obj;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(jobId, that.jobId)) return false;
return true;
}

View File

@ -20,6 +20,7 @@ package org.jclouds.cloudstack.domain;
import java.util.Date;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -346,22 +347,8 @@ public class AsyncJob<T> {
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (accountId ^ (accountId >>> 32));
result = prime * result + ((cmd == null) ? 0 : cmd.hashCode());
result = prime * result + ((created == null) ? 0 : created.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + (int) (instanceId ^ (instanceId >>> 32));
result = prime * result + ((instanceType == null) ? 0 : instanceType.hashCode());
result = prime * result + ((error == null) ? 0 : error.hashCode());
result = prime * result + progress;
result = prime * result + ((this.result == null) ? 0 : this.result.hashCode());
result = prime * result + resultCode.code();
result = prime * result + ((resultType == null) ? 0 : resultType.hashCode());
result = prime * result + status.code();
result = prime * result + userId;
return result;
return Objects.hashCode(accountId, cmd, created, id, instanceId, instanceType, error, progress,
result, resultCode, resultType, status, userId);
}
@Override
@ -372,51 +359,23 @@ public class AsyncJob<T> {
return false;
if (getClass() != obj.getClass())
return false;
AsyncJob<?> other = (AsyncJob<?>) obj;
if (accountId != other.accountId)
return false;
if (cmd == null) {
if (other.cmd != null)
return false;
} else if (!cmd.equals(other.cmd))
return false;
if (created == null) {
if (other.created != null)
return false;
} else if (!created.equals(other.created))
return false;
if (id != other.id)
return false;
if (instanceId != other.instanceId)
return false;
if (instanceType == null) {
if (other.instanceType != null)
return false;
} else if (!instanceType.equals(other.instanceType))
return false;
if (error == null) {
if (other.error != null)
return false;
} else if (!error.equals(other.error))
return false;
if (progress != other.progress)
return false;
if (result == null) {
if (other.result != null)
return false;
} else if (!result.equals(other.result))
return false;
if (resultCode != other.resultCode)
return false;
if (resultType == null) {
if (other.resultType != null)
return false;
} else if (!resultType.equals(other.resultType))
return false;
if (status != other.status)
return false;
if (userId != other.userId)
return false;
AsyncJob<?> that = (AsyncJob<?>) obj;
if (!Objects.equal(accountId, that.accountId)) return false;
if (!Objects.equal(cmd, that.cmd)) return false;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(instanceId, that.instanceId)) return false;
if (!Objects.equal(instanceType, that.instanceType)) return false;
if (!Objects.equal(error, that.error)) return false;
if (!Objects.equal(progress, that.progress)) return false;
if (!Objects.equal(result, that.result)) return false;
if (!Objects.equal(resultCode, that.resultCode)) return false;
if (!Objects.equal(resultType, that.resultType)) return false;
if (!Objects.equal(status, that.status)) return false;
if (!Objects.equal(userId, that.userId)) return false;
return true;
}

View File

@ -18,6 +18,7 @@
*/
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -92,11 +93,7 @@ public class AsyncJobError {
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + errorCode.code();
result = prime * result + ((errorText == null) ? 0 : errorText.hashCode());
return result;
return Objects.hashCode(errorCode, errorText);
}
@Override
@ -107,14 +104,11 @@ public class AsyncJobError {
return false;
if (getClass() != obj.getClass())
return false;
AsyncJobError other = (AsyncJobError) obj;
if (errorCode != other.errorCode)
return false;
if (errorText == null) {
if (other.errorText != null)
return false;
} else if (!errorText.equals(other.errorText))
return false;
AsyncJobError that = (AsyncJobError) obj;
if (!Objects.equal(errorCode, that.errorCode)) return false;
if (!Objects.equal(errorText, that.errorText)) return false;
return true;
}

View File

@ -18,6 +18,7 @@
*/
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -129,14 +130,7 @@ public class Capabilities {
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (canShareTemplates ? 1231 : 1237);
result = prime * result + ((cloudStackVersion == null) ? 0 : cloudStackVersion.hashCode());
result = prime * result + (securityGroupsEnabled ? 1231 : 1237);
result = prime * result + (firewallRuleUiEnabled ? 1231 : 1237);
result = prime * result + (supportELB ? 1231 : 1237);
return result;
return Objects.hashCode(canShareTemplates, cloudStackVersion, securityGroupsEnabled, firewallRuleUiEnabled, supportELB);
}
@Override
@ -147,20 +141,14 @@ public class Capabilities {
return false;
if (getClass() != obj.getClass())
return false;
Capabilities other = (Capabilities) obj;
if (canShareTemplates != other.canShareTemplates)
return false;
if (cloudStackVersion == null) {
if (other.cloudStackVersion != null)
return false;
} else if (!cloudStackVersion.equals(other.cloudStackVersion))
return false;
if (securityGroupsEnabled != other.securityGroupsEnabled)
return false;
if (firewallRuleUiEnabled != other.firewallRuleUiEnabled)
return false;
if (supportELB != other.supportELB)
return false;
Capabilities that = (Capabilities) obj;
if (!Objects.equal(canShareTemplates, that.canShareTemplates)) return false;
if (!Objects.equal(cloudStackVersion, that.cloudStackVersion)) return false;
if (!Objects.equal(securityGroupsEnabled, that.securityGroupsEnabled)) return false;
if (!Objects.equal(firewallRuleUiEnabled, that.firewallRuleUiEnabled)) return false;
if (!Objects.equal(supportELB, that.supportELB)) return false;
return true;
}

View File

@ -23,6 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Map;
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import com.google.gson.annotations.SerializedName;
@ -202,34 +203,24 @@ public class Capacity implements Comparable<Capacity> {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Capacity capacity = (Capacity) o;
Capacity that = (Capacity) o;
if (capacityTotal != capacity.capacityTotal) return false;
if (capacityUsed != capacity.capacityUsed) return false;
if (Double.compare(capacity.percentUsed, percentUsed) != 0) return false;
if (podId != capacity.podId) return false;
if (zoneId != capacity.zoneId) return false;
if (podName != null ? !podName.equals(capacity.podName) : capacity.podName != null) return false;
if (type != capacity.type) return false;
if (zoneName != null ? !zoneName.equals(capacity.zoneName) : capacity.zoneName != null) return false;
if (!Objects.equal(capacityTotal, that.capacityTotal)) return false;
if (!Objects.equal(capacityUsed, that.capacityUsed)) return false;
if (!Objects.equal(percentUsed, that.percentUsed)) return false;
if (!Objects.equal(podId, that.podId)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(podName, that.podName)) return false;
if (!Objects.equal(type, that.type)) return false;
if (!Objects.equal(zoneName, that.zoneName)) return false;
return true;
}
@Override
public int hashCode() {
int result;
long temp;
result = (int) (capacityTotal ^ (capacityTotal >>> 32));
result = 31 * result + (int) (capacityUsed ^ (capacityUsed >>> 32));
temp = percentUsed != +0.0d ? Double.doubleToLongBits(percentUsed) : 0L;
result = 31 * result + (int) (temp ^ (temp >>> 32));
result = 31 * result + (int) (podId ^ (podId >>> 32));
result = 31 * result + (podName != null ? podName.hashCode() : 0);
result = 31 * result + (type != null ? type.hashCode() : 0);
result = 31 * result + (int) (zoneId ^ (zoneId >>> 32));
result = 31 * result + (zoneName != null ? zoneName.hashCode() : 0);
return result;
return Objects.hashCode(capacityTotal, capacityUsed, percentUsed, podId, podName,
type, zoneId, zoneName);
}
@Override

View File

@ -21,6 +21,7 @@ package org.jclouds.cloudstack.domain;
import static com.google.common.base.CaseFormat.UPPER_CAMEL;
import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -194,35 +195,26 @@ public class Cluster implements Comparable<Cluster> {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Cluster cluster = (Cluster) o;
Cluster that = (Cluster) o;
if (id != cluster.id) return false;
if (podId != cluster.podId) return false;
if (zoneId != cluster.zoneId) return false;
if (allocationState != cluster.allocationState) return false;
if (clusterType != cluster.clusterType) return false;
if (hypervisor != null ? !hypervisor.equals(cluster.hypervisor) : cluster.hypervisor != null) return false;
if (managedState != cluster.managedState) return false;
if (name != null ? !name.equals(cluster.name) : cluster.name != null) return false;
if (podName != null ? !podName.equals(cluster.podName) : cluster.podName != null) return false;
if (zoneName != null ? !zoneName.equals(cluster.zoneName) : cluster.zoneName != null) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(podId, that.podId)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(allocationState, that.allocationState)) return false;
if (!Objects.equal(clusterType, that.clusterType)) return false;
if (!Objects.equal(hypervisor, that.hypervisor)) return false;
if (!Objects.equal(managedState, that.managedState)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(podName, that.podName)) return false;
if (!Objects.equal(zoneName, that.zoneName)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (allocationState != null ? allocationState.hashCode() : 0);
result = 31 * result + (clusterType != null ? clusterType.hashCode() : 0);
result = 31 * result + (hypervisor != null ? hypervisor.hashCode() : 0);
result = 31 * result + (managedState != null ? managedState.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (int) (podId ^ (podId >>> 32));
result = 31 * result + (podName != null ? podName.hashCode() : 0);
result = 31 * result + (int) (zoneId ^ (zoneId >>> 32));
result = 31 * result + (zoneName != null ? zoneName.hashCode() : 0);
return result;
return Objects.hashCode(id, allocationState, clusterType, hypervisor, managedState, name, podId, podName,
zoneId, zoneName);
}
@Override

View File

@ -19,6 +19,8 @@
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
/**
* Representation of the API configuration entry response
*
@ -106,25 +108,17 @@ public class ConfigurationEntry implements Comparable<ConfigurationEntry> {
ConfigurationEntry that = (ConfigurationEntry) o;
if (category != null ? !category.equals(that.category) : that.category != null)
return false;
if (description != null ? !description.equals(that.description) : that.description != null)
return false;
if (name != null ? !name.equals(that.name) : that.name != null)
return false;
if (value != null ? !value.equals(that.value) : that.value != null)
return false;
if (!Objects.equal(category, that.category)) return false;
if (!Objects.equal(description, that.description)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(value, that.value)) return false;
return true;
}
@Override
public int hashCode() {
int result = category != null ? category.hashCode() : 0;
result = 31 * result + (description != null ? description.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (value != null ? value.hashCode() : 0);
return result;
return Objects.hashCode(category, description, name, value);
}
@Override

View File

@ -24,6 +24,7 @@ import java.util.Date;
import java.util.Set;
import com.google.common.base.Joiner;
import com.google.common.base.Objects;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableSet;
import com.google.gson.annotations.SerializedName;
@ -209,18 +210,7 @@ public class DiskOffering implements Comparable<DiskOffering> {
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((created == null) ? 0 : created.hashCode());
result = prime * result + (customized ? 1231 : 1237);
result = prime * result + diskSize;
result = prime * result + ((displayText == null) ? 0 : displayText.hashCode());
result = prime * result + ((domain == null) ? 0 : domain.hashCode());
result = prime * result + (int) (domainId ^ (domainId >>> 32));
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((tags == null) ? 0 : tags.hashCode());
return result;
return Objects.hashCode(created, customized, diskSize, displayText, domain, domainId, id, name, tags);
}
@Override
@ -231,40 +221,18 @@ public class DiskOffering implements Comparable<DiskOffering> {
return false;
if (getClass() != obj.getClass())
return false;
DiskOffering other = (DiskOffering) obj;
if (created == null) {
if (other.created != null)
return false;
} else if (!created.equals(other.created))
return false;
if (customized != other.customized)
return false;
if (diskSize != other.diskSize)
return false;
if (displayText == null) {
if (other.displayText != null)
return false;
} else if (!displayText.equals(other.displayText))
return false;
if (domain == null) {
if (other.domain != null)
return false;
} else if (!domain.equals(other.domain))
return false;
if (domainId != other.domainId)
return false;
if (id != other.id)
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (tags == null) {
if (other.tags != null)
return false;
} else if (!tags.equals(other.tags))
return false;
DiskOffering that = (DiskOffering) obj;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(customized, that.customized)) return false;
if (!Objects.equal(diskSize, that.diskSize)) return false;
if (!Objects.equal(displayText, that.displayText)) return false;
if (!Objects.equal(domain, that.domain)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(tags, that.tags)) return false;
return true;
}

View File

@ -19,6 +19,7 @@
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -143,32 +144,22 @@ public class Domain implements Comparable<Domain> {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Domain domain = (Domain) o;
Domain that = (Domain) o;
if (hasChild != domain.hasChild) return false;
if (id != domain.id) return false;
if (level != domain.level) return false;
if (parentDomainId != domain.parentDomainId) return false;
if (name != null ? !name.equals(domain.name) : domain.name != null)
return false;
if (networkDomain != null ? !networkDomain.equals(domain.networkDomain) : domain.networkDomain != null)
return false;
if (parentDomainName != null ? !parentDomainName.equals(domain.parentDomainName) : domain.parentDomainName != null)
return false;
if (!Objects.equal(hasChild, that.hasChild)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(level, that.level)) return false;
if (!Objects.equal(parentDomainId, that.parentDomainId)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(networkDomain, that.networkDomain)) return false;
if (!Objects.equal(parentDomainName, that.parentDomainName)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (hasChild ? 1 : 0);
result = 31 * result + (int) (level ^ (level >>> 32));
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (networkDomain != null ? networkDomain.hashCode() : 0);
result = 31 * result + (int) (parentDomainId ^ (parentDomainId >>> 32));
result = 31 * result + (parentDomainName != null ? parentDomainName.hashCode() : 0);
return result;
return Objects.hashCode(id, hasChild, level, name, networkDomain, parentDomainId, parentDomainName);
}
@Override

View File

@ -18,6 +18,8 @@
*/
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
/**
* @author Andrei Savu
*/
@ -52,18 +54,15 @@ public class EncryptedPasswordAndPrivateKey {
EncryptedPasswordAndPrivateKey that = (EncryptedPasswordAndPrivateKey) o;
if (encryptedPassword != null ? !encryptedPassword.equals(that.encryptedPassword) : that.encryptedPassword != null)
return false;
if (privateKey != null ? !privateKey.equals(that.privateKey) : that.privateKey != null) return false;
if (!Objects.equal(encryptedPassword, that.encryptedPassword)) return false;
if (!Objects.equal(privateKey, that.privateKey)) return false;
return true;
}
@Override
public int hashCode() {
int result = encryptedPassword != null ? encryptedPassword.hashCode() : 0;
result = 31 * result + (privateKey != null ? privateKey.hashCode() : 0);
return result;
return Objects.hashCode(encryptedPassword, privateKey);
}
@Override

View File

@ -18,6 +18,8 @@
*/
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import java.util.Date;
/**
@ -230,37 +232,26 @@ public class Event implements Comparable<Event> {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Event event = (Event) o;
Event that = (Event) o;
if (domainId != event.domainId) return false;
if (id != event.id) return false;
if (account != null ? !account.equals(event.account) : event.account != null) return false;
if (created != null ? !created.equals(event.created) : event.created != null) return false;
if (description != null ? !description.equals(event.description) : event.description != null) return false;
if (domain != null ? !domain.equals(event.domain) : event.domain != null) return false;
if (level != null ? !level.equals(event.level) : event.level != null) return false;
if (parentId != null ? !parentId.equals(event.parentId) : event.parentId != null) return false;
if (state != null ? !state.equals(event.state) : event.state != null) return false;
if (type != null ? !type.equals(event.type) : event.type != null) return false;
if (username != null ? !username.equals(event.username) : event.username != null) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(account, that.account)) return false;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(description, that.description)) return false;
if (!Objects.equal(domain, that.domain)) return false;
if (!Objects.equal(level, that.level)) return false;
if (!Objects.equal(parentId, that.parentId)) return false;
if (!Objects.equal(state, that.state)) return false;
if (!Objects.equal(type, that.type)) return false;
if (!Objects.equal(username, that.username)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (account != null ? account.hashCode() : 0);
result = 31 * result + (description != null ? description.hashCode() : 0);
result = 31 * result + (created != null ? created.hashCode() : 0);
result = 31 * result + (domain != null ? domain.hashCode() : 0);
result = 31 * result + (int) (domainId ^ (domainId >>> 32));
result = 31 * result + (level != null ? level.hashCode() : 0);
result = 31 * result + (parentId != null ? parentId.hashCode() : 0);
result = 31 * result + (state != null ? state.hashCode() : 0);
result = 31 * result + (type != null ? type.hashCode() : 0);
result = 31 * result + (username != null ? username.hashCode() : 0);
return result;
return Objects.hashCode(id, account, description, created, domain, domainId, level, parentId, state, type, username);
}
@Override

View File

@ -21,6 +21,7 @@ package org.jclouds.cloudstack.domain;
import java.util.Set;
import com.google.common.base.CaseFormat;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.gson.annotations.SerializedName;
@ -233,40 +234,23 @@ public class FirewallRule implements Comparable<FirewallRule> {
FirewallRule that = (FirewallRule) o;
if (endPort != that.endPort) return false;
if (id != that.id) return false;
if (startPort != that.startPort) return false;
if (CIDRs != null ? !CIDRs.equals(that.CIDRs) : that.CIDRs != null)
return false;
if (icmpCode != null ? !icmpCode.equals(that.icmpCode) : that.icmpCode != null)
return false;
if (icmpType != null ? !icmpType.equals(that.icmpType) : that.icmpType != null)
return false;
if (ipAddress != null ? !ipAddress.equals(that.ipAddress) : that.ipAddress != null)
return false;
if (ipAddressId != that.ipAddressId)
return false;
if (protocol != null ? !protocol.equals(that.protocol) : that.protocol != null)
return false;
if (state != null ? !state.equals(that.state) : that.state != null)
return false;
if (!Objects.equal(endPort, that.endPort)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(startPort, that.startPort)) return false;
if (!Objects.equal(CIDRs, that.CIDRs)) return false;
if (!Objects.equal(icmpCode, that.icmpCode)) return false;
if (!Objects.equal(icmpType, that.icmpType)) return false;
if (!Objects.equal(ipAddress, that.ipAddress)) return false;
if (!Objects.equal(ipAddressId, that.ipAddressId)) return false;
if (!Objects.equal(protocol, that.protocol)) return false;
if (!Objects.equal(state, that.state)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (CIDRs != null ? CIDRs.hashCode() : 0);
result = 31 * result + startPort;
result = 31 * result + endPort;
result = 31 * result + (icmpCode != null ? icmpCode.hashCode() : 0);
result = 31 * result + (icmpType != null ? icmpType.hashCode() : 0);
result = 31 * result + (ipAddress != null ? ipAddress.hashCode() : 0);
result = 31 * result + (int) (ipAddressId ^ (ipAddressId >>> 32));
result = 31 * result + (protocol != null ? protocol.hashCode() : 0);
result = 31 * result + (state != null ? state.hashCode() : 0);
return result;
return Objects.hashCode(endPort, id, startPort, CIDRs, icmpCode, icmpType, ipAddress, ipAddressId, protocol, state);
}
@Override

View File

@ -23,6 +23,7 @@ import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE;
import java.util.Date;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -693,99 +694,62 @@ public class Host implements Comparable<Host> {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Host host = (Host) o;
Host that = (Host) o;
if (averageLoad != host.averageLoad) return false;
if (clusterId != host.clusterId) return false;
if (cpuNumber != host.cpuNumber) return false;
if (cpuSpeed != host.cpuSpeed) return false;
if (Float.compare(host.cpuWithOverProvisioning, cpuWithOverProvisioning) != 0) return false;
if (diskSizeAllocated != host.diskSizeAllocated) return false;
if (diskSizeTotal != host.diskSizeTotal) return false;
if (hasEnoughCapacity != host.hasEnoughCapacity) return false;
if (id != host.id) return false;
if (jobId != host.jobId) return false;
if (localStorageActive != host.localStorageActive) return false;
if (managementServerId != host.managementServerId) return false;
if (memoryAllocated != host.memoryAllocated) return false;
if (memoryTotal != host.memoryTotal) return false;
if (memoryUsed != host.memoryUsed) return false;
if (networkKbsRead != host.networkKbsRead) return false;
if (networkKbsWrite != host.networkKbsWrite) return false;
if (osCategoryId != host.osCategoryId) return false;
if (osCategoryName != host.osCategoryName) return false;
if (podId != host.podId) return false;
if (zoneId != host.zoneId) return false;
if (allocationState != host.allocationState) return false;
if (capabilities != null ? !capabilities.equals(host.capabilities) : host.capabilities != null) return false;
if (clusterName != null ? !clusterName.equals(host.clusterName) : host.clusterName != null) return false;
if (clusterType != host.clusterType) return false;
if (cpuAllocated != null ? !cpuAllocated.equals(host.cpuAllocated) : host.cpuAllocated != null) return false;
if (cpuUsed != null ? !cpuUsed.equals(host.cpuUsed) : host.cpuUsed != null) return false;
if (created != null ? !created.equals(host.created) : host.created != null) return false;
if (disconnected != null ? !disconnected.equals(host.disconnected) : host.disconnected != null) return false;
if (events != null ? !events.equals(host.events) : host.events != null) return false;
if (hostTags != null ? !hostTags.equals(host.hostTags) : host.hostTags != null) return false;
if (hypervisor != null ? !hypervisor.equals(host.hypervisor) : host.hypervisor != null) return false;
if (ipAddress != null ? !ipAddress.equals(host.ipAddress) : host.ipAddress != null) return false;
if (jobStatus != host.jobStatus) return false;
if (lastPinged != null ? !lastPinged.equals(host.lastPinged) : host.lastPinged != null) return false;
if (name != null ? !name.equals(host.name) : host.name != null) return false;
if (podName != null ? !podName.equals(host.podName) : host.podName != null) return false;
if (removed != null ? !removed.equals(host.removed) : host.removed != null) return false;
if (state != host.state) return false;
if (type != host.type) return false;
if (version != null ? !version.equals(host.version) : host.version != null) return false;
if (zoneName != null ? !zoneName.equals(host.zoneName) : host.zoneName != null) return false;
if (!Objects.equal(averageLoad, that.averageLoad)) return false;
if (!Objects.equal(clusterId, that.clusterId)) return false;
if (!Objects.equal(cpuNumber, that.cpuNumber)) return false;
if (!Objects.equal(cpuSpeed, that.cpuSpeed)) return false;
if (!Objects.equal(cpuWithOverProvisioning, that.cpuWithOverProvisioning)) return false;
if (!Objects.equal(diskSizeAllocated, that.diskSizeAllocated)) return false;
if (!Objects.equal(diskSizeTotal, that.diskSizeTotal)) return false;
if (!Objects.equal(hasEnoughCapacity, that.hasEnoughCapacity)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(jobId, that.jobId)) return false;
if (!Objects.equal(localStorageActive, that.localStorageActive)) return false;
if (!Objects.equal(managementServerId, that.managementServerId)) return false;
if (!Objects.equal(memoryAllocated, that.memoryAllocated)) return false;
if (!Objects.equal(memoryTotal, that.memoryTotal)) return false;
if (!Objects.equal(memoryUsed, that.memoryUsed)) return false;
if (!Objects.equal(networkKbsRead, that.networkKbsRead)) return false;
if (!Objects.equal(networkKbsWrite, that.networkKbsWrite)) return false;
if (!Objects.equal(osCategoryId, that.osCategoryId)) return false;
if (!Objects.equal(osCategoryName, that.osCategoryName)) return false;
if (!Objects.equal(podId, that.podId)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(allocationState, that.allocationState)) return false;
if (!Objects.equal(capabilities, that.capabilities)) return false;
if (!Objects.equal(clusterName, that.clusterName)) return false;
if (!Objects.equal(clusterType, that.clusterType)) return false;
if (!Objects.equal(cpuAllocated, that.cpuAllocated)) return false;
if (!Objects.equal(cpuUsed, that.cpuUsed)) return false;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(disconnected, that.disconnected)) return false;
if (!Objects.equal(events, that.events)) return false;
if (!Objects.equal(hostTags, that.hostTags)) return false;
if (!Objects.equal(hypervisor, that.hypervisor)) return false;
if (!Objects.equal(ipAddress, that.ipAddress)) return false;
if (!Objects.equal(jobStatus, that.jobStatus)) return false;
if (!Objects.equal(lastPinged, that.lastPinged)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(podName, that.podName)) return false;
if (!Objects.equal(removed, that.removed)) return false;
if (!Objects.equal(state, that.state)) return false;
if (!Objects.equal(type, that.type)) return false;
if (!Objects.equal(version, that.version)) return false;
if (!Objects.equal(zoneName, that.zoneName)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (allocationState != null ? allocationState.hashCode() : 0);
result = 31 * result + averageLoad;
result = 31 * result + (capabilities != null ? capabilities.hashCode() : 0);
result = 31 * result + (int) (clusterId ^ (clusterId >>> 32));
result = 31 * result + (clusterName != null ? clusterName.hashCode() : 0);
result = 31 * result + (clusterType != null ? clusterType.hashCode() : 0);
result = 31 * result + (cpuAllocated != null ? cpuAllocated.hashCode() : 0);
result = 31 * result + cpuNumber;
result = 31 * result + cpuSpeed;
result = 31 * result + (cpuUsed != null ? cpuUsed.hashCode() : 0);
result = 31 * result + (cpuWithOverProvisioning != +0.0f ? Float.floatToIntBits(cpuWithOverProvisioning) : 0);
result = 31 * result + (created != null ? created.hashCode() : 0);
result = 31 * result + (disconnected != null ? disconnected.hashCode() : 0);
result = 31 * result + (int) (diskSizeAllocated ^ (diskSizeAllocated >>> 32));
result = 31 * result + (int) (diskSizeTotal ^ (diskSizeTotal >>> 32));
result = 31 * result + (events != null ? events.hashCode() : 0);
result = 31 * result + (hasEnoughCapacity ? 1 : 0);
result = 31 * result + (hostTags != null ? hostTags.hashCode() : 0);
result = 31 * result + (hypervisor != null ? hypervisor.hashCode() : 0);
result = 31 * result + (ipAddress != null ? ipAddress.hashCode() : 0);
result = 31 * result + (localStorageActive ? 1 : 0);
result = 31 * result + (int) (jobId ^ (jobId >>> 32));
result = 31 * result + (jobStatus != null ? jobStatus.hashCode() : 0);
result = 31 * result + (lastPinged != null ? lastPinged.hashCode() : 0);
result = 31 * result + (int) (managementServerId ^ (managementServerId >>> 32));
result = 31 * result + (int) (memoryAllocated ^ (memoryAllocated >>> 32));
result = 31 * result + (int) (memoryTotal ^ (memoryTotal >>> 32));
result = 31 * result + (int) (memoryUsed ^ (memoryUsed >>> 32));
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (int) (networkKbsRead ^ (networkKbsRead >>> 32));
result = 31 * result + (int) (networkKbsWrite ^ (networkKbsWrite >>> 32));
result = 31 * result + (int) (osCategoryId ^ (osCategoryId >>> 32));
result = 31 * result + (int) (osCategoryName ^ (osCategoryName >>> 32));
result = 31 * result + (int) (podId ^ (podId >>> 32));
result = 31 * result + (podName != null ? podName.hashCode() : 0);
result = 31 * result + (removed != null ? removed.hashCode() : 0);
result = 31 * result + (state != null ? state.hashCode() : 0);
result = 31 * result + (type != null ? type.hashCode() : 0);
result = 31 * result + (version != null ? version.hashCode() : 0);
result = 31 * result + (int) (zoneId ^ (zoneId >>> 32));
result = 31 * result + (zoneName != null ? zoneName.hashCode() : 0);
return result;
return Objects.hashCode(averageLoad, clusterId, cpuNumber, cpuSpeed, cpuWithOverProvisioning, diskSizeAllocated,
diskSizeTotal, hasEnoughCapacity, id, jobId, localStorageActive, managementServerId,
memoryAllocated, memoryTotal, memoryUsed, networkKbsRead, networkKbsWrite, osCategoryId,
osCategoryName, podId, zoneId, allocationState, capabilities, clusterName, clusterType,
cpuAllocated, cpuUsed, created, disconnected, events, hostTags, hypervisor, ipAddress,
jobStatus, lastPinged, name, podName, removed, state, type, version, zoneName);
}
@Override

View File

@ -21,6 +21,7 @@ package org.jclouds.cloudstack.domain;
import java.util.Collections;
import java.util.Set;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import com.google.gson.annotations.SerializedName;
@ -280,76 +281,34 @@ public class IPForwardingRule implements Comparable<IPForwardingRule> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((IPAddress == null) ? 0 : IPAddress.hashCode());
result = prime * result + (int) (IPAddressId ^ (IPAddressId >>> 32));
result = prime * result + endPort;
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((protocol == null) ? 0 : protocol.hashCode());
result = prime * result + startPort;
result = prime * result + publicEndPort;
result = prime * result + privateEndPort;
result = prime * result + publicPort;
result = prime * result + ((state == null) ? 0 : state.hashCode());
result = prime * result + ((virtualMachineDisplayName == null) ? 0 : virtualMachineDisplayName.hashCode());
result = prime * result + (int) (virtualMachineId ^ (virtualMachineId >>> 32));
result = prime * result + ((virtualMachineName == null) ? 0 : virtualMachineName.hashCode());
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
IPForwardingRule that = (IPForwardingRule) o;
if (!Objects.equal(IPAddress, that.IPAddress)) return false;
if (!Objects.equal(IPAddressId, that.IPAddressId)) return false;
if (!Objects.equal(endPort, that.endPort)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(protocol, that.protocol)) return false;
if (!Objects.equal(startPort, that.startPort)) return false;
if (!Objects.equal(publicEndPort, that.publicEndPort)) return false;
if (!Objects.equal(privateEndPort, that.privateEndPort)) return false;
if (!Objects.equal(publicPort, that.publicPort)) return false;
if (!Objects.equal(state, that.state)) return false;
if (!Objects.equal(virtualMachineDisplayName, that.virtualMachineDisplayName)) return false;
if (!Objects.equal(virtualMachineId, that.virtualMachineId)) return false;
if (!Objects.equal(virtualMachineName, that.virtualMachineName)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
IPForwardingRule other = (IPForwardingRule) obj;
if (IPAddress == null) {
if (other.IPAddress != null)
return false;
} else if (!IPAddress.equals(other.IPAddress))
return false;
if (IPAddressId != other.IPAddressId)
return false;
if (endPort != other.endPort)
return false;
if (publicPort != other.publicPort)
return false;
if (publicEndPort != other.publicEndPort)
return false;
if (privateEndPort != other.privateEndPort)
return false;
if (id != other.id)
return false;
if (protocol == null) {
if (other.protocol != null)
return false;
} else if (!protocol.equals(other.protocol))
return false;
if (startPort != other.startPort)
return false;
if (state == null) {
if (other.state != null)
return false;
} else if (!state.equals(other.state))
return false;
if (virtualMachineDisplayName == null) {
if (other.virtualMachineDisplayName != null)
return false;
} else if (!virtualMachineDisplayName.equals(other.virtualMachineDisplayName))
return false;
if (virtualMachineId != other.virtualMachineId)
return false;
if (virtualMachineName == null) {
if (other.virtualMachineName != null)
return false;
} else if (!virtualMachineName.equals(other.virtualMachineName))
return false;
return true;
public int hashCode() {
return Objects.hashCode(IPAddress, IPAddressId, endPort, id, protocol, startPort, publicEndPort,
privateEndPort, publicPort, state, virtualMachineDisplayName,
virtualMachineId, virtualMachineName);
}
@Override

View File

@ -22,6 +22,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Date;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -613,79 +614,50 @@ public class ISO implements Comparable<ISO> {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ISO iso = (ISO) o;
ISO that = (ISO) o;
if (accountId != iso.accountId) return false;
if (bootable != iso.bootable) return false;
if (crossZones != iso.crossZones) return false;
if (domainid != iso.domainid) return false;
if (hostId != iso.hostId) return false;
if (id != iso.id) return false;
if (isExtractable != iso.isExtractable) return false;
if (isFeatured != iso.isFeatured) return false;
if (isPublic != iso.isPublic) return false;
if (isReady != iso.isReady) return false;
if (jobId != iso.jobId) return false;
if (osTypeId != iso.osTypeId) return false;
if (passwordEnabled != iso.passwordEnabled) return false;
if (size != iso.size) return false;
if (sourceTemplateId != iso.sourceTemplateId) return false;
if (zoneId != iso.zoneId) return false;
if (account != null ? !account.equals(iso.account) : iso.account != null) return false;
if (checksum != null ? !checksum.equals(iso.checksum) : iso.checksum != null) return false;
if (created != null ? !created.equals(iso.created) : iso.created != null) return false;
if (displayText != null ? !displayText.equals(iso.displayText) : iso.displayText != null) return false;
if (domain != null ? !domain.equals(iso.domain) : iso.domain != null) return false;
if (format != null ? !format.equals(iso.format) : iso.format != null) return false;
if (hostName != null ? !hostName.equals(iso.hostName) : iso.hostName != null) return false;
if (hypervisor != null ? !hypervisor.equals(iso.hypervisor) : iso.hypervisor != null) return false;
if (jobStatus != null ? !jobStatus.equals(iso.jobStatus) : iso.jobStatus != null) return false;
if (name != null ? !name.equals(iso.name) : iso.name != null) return false;
if (osTypeName != null ? !osTypeName.equals(iso.osTypeName) : iso.osTypeName != null) return false;
if (removed != null ? !removed.equals(iso.removed) : iso.removed != null) return false;
if (status != null ? !status.equals(iso.status) : iso.status != null) return false;
if (templateTag != null ? !templateTag.equals(iso.templateTag) : iso.templateTag != null) return false;
if (templateType != null ? !templateType.equals(iso.templateType) : iso.templateType != null) return false;
if (zoneName != null ? !zoneName.equals(iso.zoneName) : iso.zoneName != null) return false;
if (!Objects.equal(accountId, that.accountId)) return false;
if (!Objects.equal(bootable, that.bootable)) return false;
if (!Objects.equal(crossZones, that.crossZones)) return false;
if (!Objects.equal(domainid, that.domainid)) return false;
if (!Objects.equal(hostId, that.hostId)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(isExtractable, that.isExtractable)) return false;
if (!Objects.equal(isPublic, that.isPublic)) return false;
if (!Objects.equal(isReady, that.isReady)) return false;
if (!Objects.equal(jobId, that.jobId)) return false;
if (!Objects.equal(osTypeId, that.osTypeId)) return false;
if (!Objects.equal(passwordEnabled, that.passwordEnabled)) return false;
if (!Objects.equal(size, that.size)) return false;
if (!Objects.equal(sourceTemplateId, that.sourceTemplateId)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(account, that.account)) return false;
if (!Objects.equal(checksum, that.checksum)) return false;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(displayText, that.displayText)) return false;
if (!Objects.equal(domain, that.domain)) return false;
if (!Objects.equal(format, that.format)) return false;
if (!Objects.equal(hostName, that.hostName)) return false;
if (!Objects.equal(hypervisor, that.hypervisor)) return false;
if (!Objects.equal(jobStatus, that.jobStatus)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(osTypeName, that.osTypeName)) return false;
if (!Objects.equal(removed, that.removed)) return false;
if (!Objects.equal(status, that.status)) return false;
if (!Objects.equal(templateTag, that.templateTag)) return false;
if (!Objects.equal(templateType, that.templateType)) return false;
if (!Objects.equal(zoneName, that.zoneName)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (account != null ? account.hashCode() : 0);
result = 31 * result + (int) (accountId ^ (accountId >>> 32));
result = 31 * result + (bootable ? 1 : 0);
result = 31 * result + (checksum != null ? checksum.hashCode() : 0);
result = 31 * result + (created != null ? created.hashCode() : 0);
result = 31 * result + (crossZones ? 1 : 0);
result = 31 * result + (displayText != null ? displayText.hashCode() : 0);
result = 31 * result + (domain != null ? domain.hashCode() : 0);
result = 31 * result + (int) (domainid ^ (domainid >>> 32));
result = 31 * result + (format != null ? format.hashCode() : 0);
result = 31 * result + (int) (hostId ^ (hostId >>> 32));
result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
result = 31 * result + (hypervisor != null ? hypervisor.hashCode() : 0);
result = 31 * result + (isExtractable ? 1 : 0);
result = 31 * result + (isFeatured ? 1 : 0);
result = 31 * result + (isPublic ? 1 : 0);
result = 31 * result + (isReady ? 1 : 0);
result = 31 * result + (int) (jobId ^ (jobId >>> 32));
result = 31 * result + (jobStatus != null ? jobStatus.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (int) (osTypeId ^ (osTypeId >>> 32));
result = 31 * result + (osTypeName != null ? osTypeName.hashCode() : 0);
result = 31 * result + (passwordEnabled ? 1 : 0);
result = 31 * result + (removed != null ? removed.hashCode() : 0);
result = 31 * result + (int) (size ^ (size >>> 32));
result = 31 * result + (int) (sourceTemplateId ^ (sourceTemplateId >>> 32));
result = 31 * result + (status != null ? status.hashCode() : 0);
result = 31 * result + (templateTag != null ? templateTag.hashCode() : 0);
result = 31 * result + (templateType != null ? templateType.hashCode() : 0);
result = 31 * result + (int) (zoneId ^ (zoneId >>> 32));
result = 31 * result + (zoneName != null ? zoneName.hashCode() : 0);
return result;
return Objects.hashCode(accountId, bootable, crossZones, domainid, hostId, id, isExtractable,
isPublic, isReady, jobId, osTypeId, passwordEnabled, size, sourceTemplateId,
zoneId, account, checksum, created, displayText, domain, format, hostName,
hypervisor, jobStatus, name, osTypeName, removed, status, templateTag,
templateType, zoneName);
}
@Override

View File

@ -20,6 +20,7 @@ package org.jclouds.cloudstack.domain;
import java.util.Date;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -276,39 +277,26 @@ public class ISOExtraction implements Comparable<ISOExtraction> {
ISOExtraction that = (ISOExtraction) o;
if (accountId != that.accountId) return false;
if (extractId != that.extractId) return false;
if (id != that.id) return false;
if (uploadPercentage != that.uploadPercentage) return false;
if (zoneId != that.zoneId) return false;
if (created != null ? !created.equals(that.created) : that.created != null) return false;
if (extractMode != that.extractMode) return false;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
if (state != null ? !state.equals(that.state) : that.state != null) return false;
if (status != null ? !status.equals(that.status) : that.status != null) return false;
if (storageType != null ? !storageType.equals(that.storageType) : that.storageType != null) return false;
if (url != null ? !url.equals(that.url) : that.url != null) return false;
if (zoneName != null ? !zoneName.equals(that.zoneName) : that.zoneName != null) return false;
if (!Objects.equal(accountId, that.accountId)) return false;
if (!Objects.equal(extractId, that.extractId)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(uploadPercentage, that.uploadPercentage)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(extractMode, that.extractMode)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(state, that.state)) return false;
if (!Objects.equal(status, that.status)) return false;
if (!Objects.equal(storageType, that.storageType)) return false;
if (!Objects.equal(url, that.url)) return false;
if (!Objects.equal(zoneName, that.zoneName)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) (accountId ^ (accountId >>> 32));
result = 31 * result + (created != null ? created.hashCode() : 0);
result = 31 * result + (int) (extractId ^ (extractId >>> 32));
result = 31 * result + (extractMode != null ? extractMode.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (state != null ? state.hashCode() : 0);
result = 31 * result + (status != null ? status.hashCode() : 0);
result = 31 * result + (storageType != null ? storageType.hashCode() : 0);
result = 31 * result + uploadPercentage;
result = 31 * result + (url != null ? url.hashCode() : 0);
result = 31 * result + (int) (zoneId ^ (zoneId >>> 32));
result = 31 * result + (zoneName != null ? zoneName.hashCode() : 0);
return result;
return Objects.hashCode(accountId, extractId, id, uploadPercentage, zoneId, created, extractMode, name, state, status, storageType, url, zoneName);
}
@Override

View File

@ -20,6 +20,7 @@ package org.jclouds.cloudstack.domain;
import java.util.Set;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -115,37 +116,23 @@ public class ISOPermissions implements Comparable<ISOPermissions> {
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ISOPermissions other = (ISOPermissions) obj;
if (accounts == null) {
if (other.accounts != null)
return false;
} else if (!accounts.equals(other.accounts))
return false;
if (domainId != other.domainId)
return false;
if (id != other.id)
return false;
if (isPublic != other.isPublic)
return false;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ISOPermissions that = (ISOPermissions) o;
if (!Objects.equal(accounts, that.accounts)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(isPublic, that.isPublic)) return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((accounts == null) ? 0 : accounts.hashCode());
result = prime * result + (int) (domainId ^ (domainId >>> 32));
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + (isPublic ? 1231 : 1237);
return result;
return Objects.hashCode(accounts, domainId, id, isPublic);
}
@Override

View File

@ -20,6 +20,7 @@ package org.jclouds.cloudstack.domain;
import static com.google.common.base.Preconditions.checkArgument;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -197,61 +198,28 @@ public class IngressRule implements Comparable<IngressRule> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((CIDR == null) ? 0 : CIDR.hashCode());
result = prime * result + ICMPCode;
result = prime * result + ICMPType;
result = prime * result + ((account == null) ? 0 : account.hashCode());
result = prime * result + endPort;
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((protocol == null) ? 0 : protocol.hashCode());
result = prime * result + ((securityGroupName == null) ? 0 : securityGroupName.hashCode());
result = prime * result + startPort;
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
IngressRule that = (IngressRule) o;
if (!Objects.equal(CIDR, that.CIDR)) return false;
if (!Objects.equal(ICMPCode, that.ICMPCode)) return false;
if (!Objects.equal(ICMPType, that.ICMPType)) return false;
if (!Objects.equal(account, that.account)) return false;
if (!Objects.equal(endPort, that.endPort)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(protocol, that.protocol)) return false;
if (!Objects.equal(securityGroupName, that.securityGroupName)) return false;
if (!Objects.equal(startPort, that.startPort)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
IngressRule other = (IngressRule) obj;
if (CIDR == null) {
if (other.CIDR != null)
return false;
} else if (!CIDR.equals(other.CIDR))
return false;
if (ICMPCode != other.ICMPCode)
return false;
if (ICMPType != other.ICMPType)
return false;
if (account == null) {
if (other.account != null)
return false;
} else if (!account.equals(other.account))
return false;
if (endPort != other.endPort)
return false;
if (id != other.id)
return false;
if (protocol == null) {
if (other.protocol != null)
return false;
} else if (!protocol.equals(other.protocol))
return false;
if (securityGroupName == null) {
if (other.securityGroupName != null)
return false;
} else if (!securityGroupName.equals(other.securityGroupName))
return false;
if (startPort != other.startPort)
return false;
return true;
public int hashCode() {
return Objects.hashCode(CIDR, ICMPCode, ICMPType, account, endPort, id, protocol, securityGroupName, startPort);
}
@Override

View File

@ -18,6 +18,7 @@
*/
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -60,17 +61,15 @@ public class JobResult implements Comparable<JobResult> {
JobResult that = (JobResult) o;
if (success != that.success) return false;
if (displayText != null ? !displayText.equals(that.displayText) : that.displayText != null) return false;
if (!Objects.equal(success, that.success)) return false;
if (!Objects.equal(displayText, that.displayText)) return false;
return true;
}
@Override
public int hashCode() {
int result = (success ? 1 : 0);
result = 31 * result + (displayText != null ? displayText.hashCode() : 0);
return result;
return Objects.hashCode(success, displayText);
}
@Override

View File

@ -23,6 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Set;
import com.google.common.base.CaseFormat;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.gson.annotations.SerializedName;
@ -301,7 +302,7 @@ public class LoadBalancerRule implements Comparable<LoadBalancerRule> {
}
/**
* @return the id of the zone the rule belongs to
* @return the id of the zone the rule beStrings to
*/
public long getZoneId() {
return zoneId;
@ -314,82 +315,32 @@ public class LoadBalancerRule implements Comparable<LoadBalancerRule> {
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((account == null) ? 0 : account.hashCode());
result = prime * result + ((algorithm == null) ? 0 : algorithm.hashCode());
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + ((domain == null) ? 0 : domain.hashCode());
result = prime * result + (int) (domainId ^ (domainId >>> 32));
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + privatePort;
result = prime * result + ((publicIP == null) ? 0 : publicIP.hashCode());
result = prime * result + (int) (publicIPId ^ (publicIPId >>> 32));
result = prime * result + publicPort;
result = prime * result + (int) (zoneId ^ (zoneId >>> 32));
result = prime * result + ((state == null) ? 0 : state.hashCode());
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
LoadBalancerRule that = (LoadBalancerRule) o;
if (!Objects.equal(account, that.account)) return false;
if (!Objects.equal(algorithm, that.algorithm)) return false;
if (!Objects.equal(description, that.description)) return false;
if (!Objects.equal(domain, that.domain)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(privatePort, that.privatePort)) return false;
if (!Objects.equal(publicIP, that.publicIP)) return false;
if (!Objects.equal(publicIPId, that.publicIPId)) return false;
if (!Objects.equal(publicPort, that.publicPort)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(state, that.state)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
LoadBalancerRule other = (LoadBalancerRule) obj;
if (account == null) {
if (other.account != null)
return false;
} else if (!account.equals(other.account))
return false;
if (algorithm == null) {
if (other.algorithm != null)
return false;
} else if (!algorithm.equals(other.algorithm))
return false;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (domain == null) {
if (other.domain != null)
return false;
} else if (!domain.equals(other.domain))
return false;
if (domainId != other.domainId)
return false;
if (zoneId != other.zoneId)
return false;
if (id != other.id)
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (privatePort != other.privatePort)
return false;
if (publicIP == null) {
if (other.publicIP != null)
return false;
} else if (!publicIP.equals(other.publicIP))
return false;
if (publicIPId != other.publicIPId)
return false;
if (publicPort != other.publicPort)
return false;
if (state == null) {
if (other.state != null)
return false;
} else if (!state.equals(other.state))
return false;
return true;
public int hashCode() {
return Objects.hashCode(account, algorithm, description, domain, domainId, id, name, privatePort, publicIP, publicIPId, publicPort, zoneId, state);
}
@Override

View File

@ -19,6 +19,7 @@
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -242,94 +243,35 @@ public class LoginResponse implements Comparable<LoginResponse> {
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
LoginResponse other = (LoginResponse) obj;
if (accountName == null) {
if (other.accountName != null)
return false;
} else if (!accountName.equals(other.accountName))
return false;
if (accountType == null) {
if (other.accountType != null)
return false;
} else if (!accountType.equals(other.accountType))
return false;
if (domainId != other.domainId)
return false;
if (firstName == null) {
if (other.firstName != null)
return false;
} else if (!firstName.equals(other.firstName))
return false;
if (jSessionId == null) {
if (other.jSessionId != null)
return false;
} else if (!jSessionId.equals(other.jSessionId))
return false;
if (lastName == null) {
if (other.lastName != null)
return false;
} else if (!lastName.equals(other.lastName))
return false;
if (password == null) {
if (other.password != null)
return false;
} else if (!password.equals(other.password))
return false;
if (registered != other.registered)
return false;
if (sessionKey == null) {
if (other.sessionKey != null)
return false;
} else if (!sessionKey.equals(other.sessionKey))
return false;
if (timeout != other.timeout)
return false;
if (timezone == null) {
if (other.timezone != null)
return false;
} else if (!timezone.equals(other.timezone))
return false;
if (timezoneOffset == null) {
if (other.timezoneOffset != null)
return false;
} else if (!timezoneOffset.equals(other.timezoneOffset))
return false;
if (userId != other.userId)
return false;
if (username == null) {
if (other.username != null)
return false;
} else if (!username.equals(other.username))
return false;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
LoginResponse that = (LoginResponse) o;
if (!Objects.equal(accountName, that.accountName)) return false;
if (!Objects.equal(accountType, that.accountType)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(firstName, that.firstName)) return false;
if (!Objects.equal(jSessionId, that.jSessionId)) return false;
if (!Objects.equal(lastName, that.lastName)) return false;
if (!Objects.equal(password, that.password)) return false;
if (!Objects.equal(registered, that.registered)) return false;
if (!Objects.equal(sessionKey, that.sessionKey)) return false;
if (!Objects.equal(timeout, that.timeout)) return false;
if (!Objects.equal(timezone, that.timezone)) return false;
if (!Objects.equal(timezoneOffset, that.timezoneOffset)) return false;
if (!Objects.equal(userId, that.userId)) return false;
if (!Objects.equal(username, that.username)) return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((accountName == null) ? 0 : accountName.hashCode());
result = prime * result + ((accountType == null) ? 0 : accountType.hashCode());
result = prime * result + (int) (domainId ^ (domainId >>> 32));
result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
result = prime * result + ((jSessionId == null) ? 0 : jSessionId.hashCode());
result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
result = prime * result + ((password == null) ? 0 : password.hashCode());
result = prime * result + (registered ? 1231 : 1237);
result = prime * result + ((sessionKey == null) ? 0 : sessionKey.hashCode());
result = prime * result + (int) (timeout ^ (timeout >>> 32));
result = prime * result + ((timezone == null) ? 0 : timezone.hashCode());
result = prime * result + ((timezoneOffset == null) ? 0 : timezoneOffset.hashCode());
result = prime * result + (int) (userId ^ (userId >>> 32));
result = prime * result + ((username == null) ? 0 : username.hashCode());
return result;
return Objects.hashCode(accountName, accountType, domainId, firstName, jSessionId, lastName,
password, registered, sessionKey, timeout, timezone, timezoneOffset,
userId, username);
}
@Override

View File

@ -20,6 +20,7 @@ package org.jclouds.cloudstack.domain;
import java.net.URI;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -226,73 +227,30 @@ public class NIC {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((IPAddress == null) ? 0 : IPAddress.hashCode());
result = prime * result + ((broadcastURI == null) ? 0 : broadcastURI.hashCode());
result = prime * result + ((gateway == null) ? 0 : gateway.hashCode());
result = prime * result + ((guestIPType == null) ? 0 : guestIPType.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + (isDefault ? 1231 : 1237);
result = prime * result + ((isolationURI == null) ? 0 : isolationURI.hashCode());
result = prime * result + ((netmask == null) ? 0 : netmask.hashCode());
result = prime * result + ((macAddress == null) ? 0 : macAddress.hashCode());
result = prime * result + (int) (networkId ^ (networkId >>> 32));
result = prime * result + ((trafficType == null) ? 0 : trafficType.hashCode());
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NIC that = (NIC) o;
if (!Objects.equal(IPAddress, that.IPAddress)) return false;
if (!Objects.equal(broadcastURI, that.broadcastURI)) return false;
if (!Objects.equal(gateway, that.gateway)) return false;
if (!Objects.equal(guestIPType, that.guestIPType)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(isDefault, that.isDefault)) return false;
if (!Objects.equal(isolationURI, that.isolationURI)) return false;
if (!Objects.equal(netmask, that.netmask)) return false;
if (!Objects.equal(macAddress, that.macAddress)) return false;
if (!Objects.equal(networkId, that.networkId)) return false;
if (!Objects.equal(trafficType, that.trafficType)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
NIC other = (NIC) obj;
if (IPAddress == null) {
if (other.IPAddress != null)
return false;
} else if (!IPAddress.equals(other.IPAddress))
return false;
if (broadcastURI == null) {
if (other.broadcastURI != null)
return false;
} else if (!broadcastURI.equals(other.broadcastURI))
return false;
if (gateway == null) {
if (other.gateway != null)
return false;
} else if (!gateway.equals(other.gateway))
return false;
if (guestIPType != other.guestIPType)
return false;
if (id != other.id)
return false;
if (isDefault != other.isDefault)
return false;
if (isolationURI == null) {
if (other.isolationURI != null)
return false;
} else if (!isolationURI.equals(other.isolationURI))
return false;
if (netmask == null) {
if (other.netmask != null)
return false;
} else if (!netmask.equals(other.netmask))
return false;
if (macAddress == null) {
if (other.macAddress != null)
return false;
} else if (!macAddress.equals(other.macAddress))
return false;
if (networkId != other.networkId)
return false;
if (trafficType != other.trafficType)
return false;
return true;
public int hashCode() {
return Objects.hashCode(IPAddress, broadcastURI, gateway, guestIPType, id, isDefault, isolationURI, netmask, macAddress, networkId, trafficType);
}
@Override

View File

@ -28,6 +28,7 @@ import java.util.SortedSet;
import javax.annotation.Nullable;
import com.google.common.base.Joiner;
import com.google.common.base.Objects;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
@ -552,166 +553,52 @@ public class Network implements Comparable<Network> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((DNS1 == null) ? 0 : DNS1.hashCode());
result = prime * result + ((DNS2 == null) ? 0 : DNS2.hashCode());
result = prime * result + ((VLAN == null) ? 0 : VLAN.hashCode());
result = prime * result + ((broadcastDomainType == null) ? 0 : broadcastDomainType.hashCode());
result = prime * result + ((broadcastURI == null) ? 0 : broadcastURI.hashCode());
result = prime * result + ((displayText == null) ? 0 : displayText.hashCode());
result = prime * result + ((domain == null) ? 0 : domain.hashCode());
result = prime * result + ((endIP == null) ? 0 : endIP.hashCode());
result = prime * result + ((gateway == null) ? 0 : gateway.hashCode());
result = prime * result + ((guestIPType == null) ? 0 : guestIPType.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + (isDefault ? 1231 : 1237);
result = prime * result + (isShared ? 1231 : 1237);
result = prime * result + (isSystem ? 1231 : 1237);
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((netmask == null) ? 0 : netmask.hashCode());
result = prime * result + ((networkDomain == null) ? 0 : networkDomain.hashCode());
result = prime * result + ((networkOfferingAvailability == null) ? 0 : networkOfferingAvailability.hashCode());
result = prime * result + ((networkOfferingDisplayText == null) ? 0 : networkOfferingDisplayText.hashCode());
result = prime * result + (int) (networkOfferingId ^ (networkOfferingId >>> 32));
result = prime * result + ((networkOfferingName == null) ? 0 : networkOfferingName.hashCode());
result = prime * result + (int) (related ^ (related >>> 32));
result = prime * result + ((services == null) ? 0 : services.hashCode());
result = prime * result + ((startIP == null) ? 0 : startIP.hashCode());
result = prime * result + ((state == null) ? 0 : state.hashCode());
result = prime * result + ((trafficType == null) ? 0 : trafficType.hashCode());
result = prime * result + (int) (zoneId ^ (zoneId >>> 32));
result = prime * result + ((tags == null) ? 0 : tags.hashCode());
result = prime * result + (int) (domainId ^ (domainId >>> 32));
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Network that = (Network) o;
if (!Objects.equal(DNS1, that.DNS1)) return false;
if (!Objects.equal(DNS2, that.DNS2)) return false;
if (!Objects.equal(VLAN, that.VLAN)) return false;
if (!Objects.equal(broadcastDomainType, that.broadcastDomainType)) return false;
if (!Objects.equal(broadcastURI, that.broadcastURI)) return false;
if (!Objects.equal(displayText, that.displayText)) return false;
if (!Objects.equal(domain, that.domain)) return false;
if (!Objects.equal(endIP, that.endIP)) return false;
if (!Objects.equal(gateway, that.gateway)) return false;
if (!Objects.equal(guestIPType, that.guestIPType)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(isDefault, that.isDefault)) return false;
if (!Objects.equal(isShared, that.isShared)) return false;
if (!Objects.equal(isSystem, that.isSystem)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(netmask, that.netmask)) return false;
if (!Objects.equal(networkDomain, that.networkDomain)) return false;
if (!Objects.equal(networkOfferingAvailability, that.networkOfferingAvailability)) return false;
if (!Objects.equal(networkOfferingDisplayText, that.networkOfferingDisplayText)) return false;
if (!Objects.equal(networkOfferingId, that.networkOfferingId)) return false;
if (!Objects.equal(networkOfferingName, that.networkOfferingName)) return false;
if (!Objects.equal(related, that.related)) return false;
if (!Objects.equal(services, that.services)) return false;
if (!Objects.equal(startIP, that.startIP)) return false;
if (!Objects.equal(state, that.state)) return false;
if (!Objects.equal(trafficType, that.trafficType)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(tags, that.tags)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Network other = (Network) obj;
if (DNS1 == null) {
if (other.DNS1 != null)
return false;
} else if (!DNS1.equals(other.DNS1))
return false;
if (DNS2 == null) {
if (other.DNS2 != null)
return false;
} else if (!DNS2.equals(other.DNS2))
return false;
if (VLAN == null) {
if (other.VLAN != null)
return false;
} else if (!VLAN.equals(other.VLAN))
return false;
if (broadcastDomainType == null) {
if (other.broadcastDomainType != null)
return false;
} else if (!broadcastDomainType.equals(other.broadcastDomainType))
return false;
if (broadcastURI == null) {
if (other.broadcastURI != null)
return false;
} else if (!broadcastURI.equals(other.broadcastURI))
return false;
if (displayText == null) {
if (other.displayText != null)
return false;
} else if (!displayText.equals(other.displayText))
return false;
if (domain == null) {
if (other.domain != null)
return false;
} else if (!domain.equals(other.domain))
return false;
if (endIP == null) {
if (other.endIP != null)
return false;
} else if (!endIP.equals(other.endIP))
return false;
if (gateway == null) {
if (other.gateway != null)
return false;
} else if (!gateway.equals(other.gateway))
return false;
if (guestIPType != other.guestIPType)
return false;
if (id != other.id)
return false;
if (isDefault != other.isDefault)
return false;
if (isShared != other.isShared)
return false;
if (isSystem != other.isSystem)
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (netmask == null) {
if (other.netmask != null)
return false;
} else if (!netmask.equals(other.netmask))
return false;
if (networkDomain == null) {
if (other.networkDomain != null)
return false;
} else if (!networkDomain.equals(other.networkDomain))
return false;
if (networkOfferingAvailability == null) {
if (other.networkOfferingAvailability != null)
return false;
} else if (!networkOfferingAvailability.equals(other.networkOfferingAvailability))
return false;
if (networkOfferingDisplayText == null) {
if (other.networkOfferingDisplayText != null)
return false;
} else if (!networkOfferingDisplayText.equals(other.networkOfferingDisplayText))
return false;
if (networkOfferingId != other.networkOfferingId)
return false;
if (networkOfferingName == null) {
if (other.networkOfferingName != null)
return false;
} else if (!networkOfferingName.equals(other.networkOfferingName))
return false;
if (related != other.related)
return false;
if (services == null) {
if (other.services != null)
return false;
} else if (!services.equals(other.services))
return false;
if (startIP == null) {
if (other.startIP != null)
return false;
} else if (!startIP.equals(other.startIP))
return false;
if (state == null) {
if (other.state != null)
return false;
} else if (!state.equals(other.state))
return false;
if (trafficType != other.trafficType)
return false;
if (zoneId != other.zoneId)
return false;
if (tags == null) {
if (other.tags != null)
return false;
} else if (!tags.equals(other.tags))
return false;
if (domainId != other.domainId)
return false;
return true;
public int hashCode() {
return Objects.hashCode(DNS1, DNS2, VLAN, broadcastDomainType, broadcastURI, displayText, domain,
endIP, gateway, guestIPType, id, isDefault, isShared, isSystem, name,
netmask, networkDomain, networkOfferingAvailability, networkOfferingDisplayText,
networkOfferingId, networkOfferingName, related, services, startIP, state,
trafficType, zoneId, tags, domainId);
}
@Override

View File

@ -26,6 +26,7 @@ import java.util.Set;
import javax.annotation.Nullable;
import com.google.common.base.Joiner;
import com.google.common.base.Objects;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableSet;
import com.google.gson.annotations.SerializedName;
@ -266,70 +267,29 @@ public class NetworkOffering implements Comparable<NetworkOffering> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((availability == null) ? 0 : availability.hashCode());
result = prime * result + ((created == null) ? 0 : created.hashCode());
result = prime * result + ((displayText == null) ? 0 : displayText.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + (isDefault ? 1231 : 1237);
result = prime * result + ((maxConnections == null) ? 0 : maxConnections.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + (supportsVLAN ? 1231 : 1237);
result = prime * result + ((tags == null) ? 0 : tags.hashCode());
result = prime * result + ((trafficType == null) ? 0 : trafficType.hashCode());
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NetworkOffering that = (NetworkOffering) o;
if (!Objects.equal(availability, that.availability)) return false;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(displayText, that.displayText)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(isDefault, that.isDefault)) return false;
if (!Objects.equal(maxConnections, that.maxConnections)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(supportsVLAN, that.supportsVLAN)) return false;
if (!Objects.equal(tags, that.tags)) return false;
if (!Objects.equal(trafficType, that.trafficType)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
NetworkOffering other = (NetworkOffering) obj;
if (availability == null) {
if (other.availability != null)
return false;
} else if (!availability.equals(other.availability))
return false;
if (created == null) {
if (other.created != null)
return false;
} else if (!created.equals(other.created))
return false;
if (displayText == null) {
if (other.displayText != null)
return false;
} else if (!displayText.equals(other.displayText))
return false;
if (id != other.id)
return false;
if (isDefault != other.isDefault)
return false;
if (maxConnections == null) {
if (other.maxConnections != null)
return false;
} else if (!maxConnections.equals(other.maxConnections))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (supportsVLAN != other.supportsVLAN)
return false;
if (tags == null) {
if (other.tags != null)
return false;
} else if (!tags.equals(other.tags))
return false;
if (trafficType != other.trafficType)
return false;
return true;
public int hashCode() {
return Objects.hashCode(availability, created, displayText, id, isDefault, maxConnections, name, supportsVLAN, tags, trafficType);
}
@Override

View File

@ -24,6 +24,7 @@ import java.util.Map;
import java.util.SortedSet;
import java.util.Map.Entry;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSortedMap;
import com.google.common.collect.ImmutableSortedSet;
@ -51,34 +52,21 @@ public class NetworkService implements Comparable<NetworkService> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((value == null) ? 0 : value.hashCode());
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NetworkService.Capability that = (NetworkService.Capability) o;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(value, that.value)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
NetworkService.Capability other = (NetworkService.Capability) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (value == null) {
if (other.value != null)
return false;
} else if (!value.equals(other.value))
return false;
return true;
public int hashCode() {
return Objects.hashCode(name, value);
}
@Override
@ -128,34 +116,21 @@ public class NetworkService implements Comparable<NetworkService> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((capabilities == null) ? 0 : capabilities.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NetworkService that = (NetworkService) o;
if (!Objects.equal(capabilities, that.capabilities)) return false;
if (!Objects.equal(name, that.name)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
NetworkService other = (NetworkService) obj;
if (capabilities == null) {
if (other.capabilities != null)
return false;
} else if (!capabilities.equals(other.capabilities))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
public int hashCode() {
return Objects.hashCode(capabilities, name);
}
@Override

View File

@ -18,6 +18,7 @@
*/
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -93,34 +94,22 @@ public class OSType implements Comparable<OSType> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (OSCategoryId ^ (OSCategoryId >>> 32));
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
OSType that = (OSType) o;
if (!Objects.equal(OSCategoryId, that.OSCategoryId)) return false;
if (!Objects.equal(description, that.description)) return false;
if (!Objects.equal(id, that.id)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
OSType other = (OSType) obj;
if (OSCategoryId != other.OSCategoryId)
return false;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (id != other.id)
return false;
return true;
public int hashCode() {
return Objects.hashCode(OSCategoryId, description, id);
}
@Override

View File

@ -18,6 +18,7 @@
*/
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -219,33 +220,24 @@ public class Pod implements Comparable<Pod> {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Pod pod = (Pod) o;
Pod that = (Pod) o;
if (id != pod.id) return false;
if (zoneId != pod.zoneId) return false;
if (allocationState != pod.allocationState) return false;
if (endIp != null ? !endIp.equals(pod.endIp) : pod.endIp != null) return false;
if (gateway != null ? !gateway.equals(pod.gateway) : pod.gateway != null) return false;
if (name != null ? !name.equals(pod.name) : pod.name != null) return false;
if (netmask != null ? !netmask.equals(pod.netmask) : pod.netmask != null) return false;
if (startIp != null ? !startIp.equals(pod.startIp) : pod.startIp != null) return false;
if (zoneName != null ? !zoneName.equals(pod.zoneName) : pod.zoneName != null) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(allocationState, that.allocationState)) return false;
if (!Objects.equal(endIp, that.endIp)) return false;
if (!Objects.equal(gateway, that.gateway)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(netmask, that.netmask)) return false;
if (!Objects.equal(startIp, that.startIp)) return false;
if (!Objects.equal(zoneName, that.zoneName)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (int) (zoneId ^ (zoneId >>> 32));
result = 31 * result + (zoneName != null ? zoneName.hashCode() : 0);
result = 31 * result + (gateway != null ? gateway.hashCode() : 0);
result = 31 * result + (netmask != null ? netmask.hashCode() : 0);
result = 31 * result + (startIp != null ? startIp.hashCode() : 0);
result = 31 * result + (endIp != null ? endIp.hashCode() : 0);
result = 31 * result + (allocationState != null ? allocationState.hashCode() : 0);
return result;
return Objects.hashCode(id, zoneId, allocationState, endIp, gateway, name, netmask, startIp, zoneName);
}
@Override

View File

@ -21,6 +21,7 @@ package org.jclouds.cloudstack.domain;
import java.util.Set;
import com.google.common.base.CaseFormat;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.gson.annotations.SerializedName;
@ -301,67 +302,29 @@ public class PortForwardingRule implements Comparable<PortForwardingRule> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((IPAddress == null) ? 0 : IPAddress.hashCode());
result = prime * result + (int) (IPAddressId ^ (IPAddressId >>> 32));
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + privatePort;
result = prime * result + ((protocol == null) ? 0 : protocol.hashCode());
result = prime * result + publicPort;
result = prime * result + ((state == null) ? 0 : state.hashCode());
result = prime * result + ((virtualMachineDisplayName == null) ? 0 : virtualMachineDisplayName.hashCode());
result = prime * result + (int) (virtualMachineId ^ (virtualMachineId >>> 32));
result = prime * result + ((virtualMachineName == null) ? 0 : virtualMachineName.hashCode());
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PortForwardingRule that = (PortForwardingRule) o;
if (!Objects.equal(IPAddress, that.IPAddress)) return false;
if (!Objects.equal(IPAddressId, that.IPAddressId)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(privatePort, that.privatePort)) return false;
if (!Objects.equal(protocol, that.protocol)) return false;
if (!Objects.equal(publicPort, that.publicPort)) return false;
if (!Objects.equal(state, that.state)) return false;
if (!Objects.equal(virtualMachineDisplayName, that.virtualMachineDisplayName)) return false;
if (!Objects.equal(virtualMachineId, that.virtualMachineId)) return false;
if (!Objects.equal(virtualMachineName, that.virtualMachineName)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PortForwardingRule other = (PortForwardingRule) obj;
if (IPAddress == null) {
if (other.IPAddress != null)
return false;
} else if (!IPAddress.equals(other.IPAddress))
return false;
if (IPAddressId != other.IPAddressId)
return false;
if (id != other.id)
return false;
if (privatePort != other.privatePort)
return false;
if (protocol == null) {
if (other.protocol != null)
return false;
} else if (!protocol.equals(other.protocol))
return false;
if (privatePort != other.privatePort)
return false;
if (state == null) {
if (other.state != null)
return false;
} else if (!state.equals(other.state))
return false;
if (virtualMachineDisplayName == null) {
if (other.virtualMachineDisplayName != null)
return false;
} else if (!virtualMachineDisplayName.equals(other.virtualMachineDisplayName))
return false;
if (virtualMachineId != other.virtualMachineId)
return false;
if (virtualMachineName == null) {
if (other.virtualMachineName != null)
return false;
} else if (!virtualMachineName.equals(other.virtualMachineName))
return false;
return true;
public int hashCode() {
return Objects.hashCode(IPAddress, IPAddressId, id, privatePort, protocol, publicPort, state, virtualMachineDisplayName, virtualMachineId, virtualMachineName);
}
@Override

View File

@ -25,6 +25,7 @@ import java.util.Date;
import javax.annotation.Nullable;
import com.google.common.base.CaseFormat;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -425,117 +426,42 @@ public class PublicIPAddress implements Comparable<PublicIPAddress> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((IPAddress == null) ? 0 : IPAddress.hashCode());
result = prime * result + (int) (VLANId ^ (VLANId >>> 32));
result = prime * result + ((VLANName == null) ? 0 : VLANName.hashCode());
result = prime * result + ((account == null) ? 0 : account.hashCode());
result = prime * result + ((allocated == null) ? 0 : allocated.hashCode());
result = prime * result + (int) (associatedNetworkId ^ (associatedNetworkId >>> 32));
result = prime * result + ((domain == null) ? 0 : domain.hashCode());
result = prime * result + (int) (domainId ^ (domainId >>> 32));
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + (isSourceNAT ? 1231 : 1237);
result = prime * result + (isStaticNAT ? 1231 : 1237);
result = prime * result + (int) (networkId ^ (networkId >>> 32));
result = prime * result + ((state == null) ? 0 : state.hashCode());
result = prime * result + (usesVirtualNetwork ? 1231 : 1237);
result = prime * result + ((virtualMachineDisplayName == null) ? 0 : virtualMachineDisplayName.hashCode());
result = prime * result + (int) (virtualMachineId ^ (virtualMachineId >>> 32));
result = prime * result + ((virtualMachineName == null) ? 0 : virtualMachineName.hashCode());
result = prime * result + (int) (zoneId ^ (zoneId >>> 32));
result = prime * result + ((zoneName == null) ? 0 : zoneName.hashCode());
result = prime * result + ((jobStatus == null) ? 0 : jobStatus.hashCode());
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PublicIPAddress that = (PublicIPAddress) o;
if (!Objects.equal(IPAddress, that.IPAddress)) return false;
if (!Objects.equal(VLANId, that.VLANId)) return false;
if (!Objects.equal(VLANName, that.VLANName)) return false;
if (!Objects.equal(account, that.account)) return false;
if (!Objects.equal(allocated, that.allocated)) return false;
if (!Objects.equal(associatedNetworkId, that.associatedNetworkId)) return false;
if (!Objects.equal(domain, that.domain)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(isSourceNAT, that.isSourceNAT)) return false;
if (!Objects.equal(isStaticNAT, that.isStaticNAT)) return false;
if (!Objects.equal(networkId, that.networkId)) return false;
if (!Objects.equal(state, that.state)) return false;
if (!Objects.equal(usesVirtualNetwork, that.usesVirtualNetwork)) return false;
if (!Objects.equal(virtualMachineDisplayName, that.virtualMachineDisplayName)) return false;
if (!Objects.equal(virtualMachineId, that.virtualMachineId)) return false;
if (!Objects.equal(virtualMachineName, that.virtualMachineName)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(zoneName, that.zoneName)) return false;
if (!Objects.equal(jobStatus, that.jobStatus)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PublicIPAddress other = (PublicIPAddress) obj;
if (IPAddress == null) {
if (other.IPAddress != null)
return false;
} else if (!IPAddress.equals(other.IPAddress))
return false;
if (VLANId != other.VLANId)
return false;
if (VLANName == null) {
if (other.VLANName != null)
return false;
} else if (!VLANName.equals(other.VLANName))
return false;
if (account == null) {
if (other.account != null)
return false;
} else if (!account.equals(other.account))
return false;
if (allocated == null) {
if (other.allocated != null)
return false;
} else if (!allocated.equals(other.allocated))
return false;
if (associatedNetworkId != other.associatedNetworkId)
return false;
if (domain == null) {
if (other.domain != null)
return false;
} else if (!domain.equals(other.domain))
return false;
if (domainId != other.domainId)
return false;
if (id != other.id)
return false;
if (isSourceNAT != other.isSourceNAT)
return false;
if (isStaticNAT != other.isStaticNAT)
return false;
if (networkId != other.networkId)
return false;
if (state == null) {
if (other.state != null)
return false;
} else if (!state.equals(other.state))
return false;
if (usesVirtualNetwork != other.usesVirtualNetwork)
return false;
if (virtualMachineDisplayName == null) {
if (other.virtualMachineDisplayName != null)
return false;
} else if (!virtualMachineDisplayName.equals(other.virtualMachineDisplayName))
return false;
if (virtualMachineId != other.virtualMachineId)
return false;
if (virtualMachineName == null) {
if (other.virtualMachineName != null)
return false;
} else if (!virtualMachineName.equals(other.virtualMachineName))
return false;
if (zoneId != other.zoneId)
return false;
if (zoneName == null) {
if (other.zoneName != null)
return false;
} else if (!zoneName.equals(other.zoneName))
return false;
if (jobId == null) {
if (other.jobId != null)
return false;
} else if (!jobId.equals(other.jobId))
return false;
if (jobStatus == null) {
if (other.jobStatus != null)
return false;
} else if (!jobStatus.equals(other.jobStatus))
return false;
return true;
public int hashCode() {
return Objects.hashCode(IPAddress, VLANId, VLANName, account, allocated, associatedNetworkId,
domain, domainId, id, isSourceNAT, isStaticNAT, networkId, state,
usesVirtualNetwork, virtualMachineDisplayName, virtualMachineId,
virtualMachineName, zoneId, zoneName, jobStatus);
}
@Override

View File

@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Map;
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import com.google.gson.annotations.SerializedName;
@ -123,22 +124,18 @@ public class ResourceLimit implements Comparable<ResourceLimit> {
ResourceLimit that = (ResourceLimit) o;
if (domainId != that.domainId) return false;
if (max != that.max) return false;
if (resourceType != that.resourceType) return false;
if (!account.equals(that.account)) return false;
if (!domain.equals(that.domain)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(max, that.max)) return false;
if (!Objects.equal(resourceType, that.resourceType)) return false;
if (!Objects.equal(account, that.account)) return false;
if (!Objects.equal(domain, that.domain)) return false;
return true;
}
@Override
public int hashCode() {
int result = account.hashCode();
result = 31 * result + domain.hashCode();
result = 31 * result + (int) (domainId ^ (domainId >>> 32));
result = 31 * result + max;
return result;
return Objects.hashCode(domainId, max, resourceType, account, domain);
}
@Override

View File

@ -25,6 +25,7 @@ import java.util.SortedSet;
import javax.annotation.Nullable;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;
import com.google.gson.annotations.SerializedName;
@ -205,39 +206,22 @@ public class SecurityGroup implements Comparable<SecurityGroup> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (domainId ^ (domainId >>> 32));
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((jobStatus == null) ? 0 : jobStatus.hashCode());
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SecurityGroup that = (SecurityGroup) o;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(jobStatus, that.jobStatus)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
SecurityGroup other = (SecurityGroup) obj;
if (domainId != other.domainId)
return false;
if (id != other.id)
return false;
if (jobId == null) {
if (other.jobId != null)
return false;
} else if (!jobId.equals(other.jobId))
return false;
if (jobStatus == null) {
if (other.jobStatus != null)
return false;
} else if (!jobStatus.equals(other.jobStatus))
return false;
return true;
public int hashCode() {
return Objects.hashCode(domainId, id, jobStatus);
}
@Override

View File

@ -24,6 +24,7 @@ import java.util.Date;
import java.util.Set;
import com.google.common.base.Joiner;
import com.google.common.base.Objects;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableSet;
import com.google.gson.annotations.SerializedName;
@ -341,73 +342,31 @@ public class ServiceOffering implements Comparable<ServiceOffering> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + cpuNumber;
result = prime * result + cpuSpeed;
result = prime * result + ((created == null) ? 0 : created.hashCode());
result = prime * result + ((displayText == null) ? 0 : displayText.hashCode());
result = prime * result + ((domain == null) ? 0 : domain.hashCode());
result = prime * result + (int) (domainId ^ (domainId >>> 32));
result = prime * result + (haSupport ? 1231 : 1237);
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + memory;
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((storageType == null) ? 0 : storageType.hashCode());
result = prime * result + ((tags == null) ? 0 : tags.hashCode());
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ServiceOffering that = (ServiceOffering) o;
if (!Objects.equal(cpuNumber, that.cpuNumber)) return false;
if (!Objects.equal(cpuSpeed, that.cpuSpeed)) return false;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(displayText, that.displayText)) return false;
if (!Objects.equal(domain, that.domain)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(haSupport, that.haSupport)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(memory, that.memory)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(storageType, that.storageType)) return false;
if (!Objects.equal(tags, that.tags)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ServiceOffering other = (ServiceOffering) obj;
if (cpuNumber != other.cpuNumber)
return false;
if (cpuSpeed != other.cpuSpeed)
return false;
if (created == null) {
if (other.created != null)
return false;
} else if (!created.equals(other.created))
return false;
if (displayText == null) {
if (other.displayText != null)
return false;
} else if (!displayText.equals(other.displayText))
return false;
if (domain == null) {
if (other.domain != null)
return false;
} else if (!domain.equals(other.domain))
return false;
if (domainId != other.domainId)
return false;
if (haSupport != other.haSupport)
return false;
if (id != other.id)
return false;
if (memory != other.memory)
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (storageType != other.storageType)
return false;
if (tags == null) {
if (other.tags != null)
return false;
} else if (!tags.equals(other.tags))
return false;
return true;
public int hashCode() {
return Objects.hashCode(cpuNumber, cpuSpeed, created, displayText, domain, domainId, haSupport, id, memory, name, storageType, tags);
}
@Override

View File

@ -387,21 +387,9 @@ public class Snapshot implements Comparable<Snapshot> {
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (account != null ? account.hashCode() : 0);
result = 31 * result + (created != null ? created.hashCode() : 0);
result = 31 * result + (domain != null ? domain.hashCode() : 0);
result = 31 * result + (int) (domainId ^ (domainId >>> 32));
result = 31 * result + (interval != null ? interval.hashCode() : 0);
result = 31 * result + (int) (jobId ^ (jobId >>> 32));
result = 31 * result + (jobStatus != null ? jobStatus.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (snapshotType != null ? snapshotType.hashCode() : 0);
result = 31 * result + (state != null ? state.hashCode() : 0);
result = 31 * result + (int) (volumeId ^ (volumeId >>> 32));
result = 31 * result + (volumeName != null ? volumeName.hashCode() : 0);
result = 31 * result + (volumeType != null ? volumeType.hashCode() : 0);
return result;
return Objects.hashCode(domainId, id, jobId, volumeId, account, created, domain,
interval, jobStatus, name, snapshotType, state, volumeName,
volumeType);
}
@Override

View File

@ -18,6 +18,7 @@
*/
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -165,25 +166,19 @@ public class SnapshotPolicy implements Comparable<SnapshotPolicy> {
SnapshotPolicy that = (SnapshotPolicy) o;
if (id != that.id) return false;
if (numberToRetain != that.numberToRetain) return false;
if (volumeId != that.volumeId) return false;
if (interval != that.interval) return false;
if (schedule != null ? !schedule.equals(that.schedule) : that.schedule != null) return false;
if (timezone != null ? !timezone.equals(that.timezone) : that.timezone != null) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(numberToRetain, that.numberToRetain)) return false;
if (!Objects.equal(volumeId, that.volumeId)) return false;
if (!Objects.equal(interval, that.interval)) return false;
if (!Objects.equal(schedule, that.schedule)) return false;
if (!Objects.equal(timezone, that.timezone)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (interval != null ? interval.hashCode() : 0);
result = 31 * result + (int) (numberToRetain ^ (numberToRetain >>> 32));
result = 31 * result + (schedule != null ? schedule.hashCode() : 0);
result = 31 * result + (timezone != null ? timezone.hashCode() : 0);
result = 31 * result + (int) (volumeId ^ (volumeId >>> 32));
return result;
return Objects.hashCode(id, numberToRetain, volumeId, interval, schedule, timezone);
}
@Override

View File

@ -19,6 +19,7 @@
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -85,42 +86,22 @@ public class SshKeyPair implements Comparable<SshKeyPair> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((fingerprint == null) ? 0 : fingerprint.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((privateKey == null) ? 0 : privateKey.hashCode());
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
return result;
SshKeyPair that = (SshKeyPair) o;
if (!Objects.equal(fingerprint, that.fingerprint)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(privateKey, that.privateKey)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
SshKeyPair other = (SshKeyPair) obj;
if (fingerprint == null) {
if (other.fingerprint != null)
return false;
} else if (!fingerprint.equals(other.fingerprint))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (privateKey == null) {
if (other.privateKey != null)
return false;
} else if (!privateKey.equals(other.privateKey))
return false;
return true;
public int hashCode() {
return Objects.hashCode(fingerprint, name, privateKey);
}
@Override

View File

@ -23,6 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Date;
import com.google.common.base.CaseFormat;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -330,49 +331,33 @@ public class StoragePool implements Comparable<StoragePool> {
StoragePool that = (StoragePool) o;
if (clusterId != that.clusterId) return false;
if (diskSizeAllocated != that.diskSizeAllocated) return false;
if (diskSizeTotal != that.diskSizeTotal) return false;
if (id != that.id) return false;
if (podId != that.podId) return false;
if (zoneId != that.zoneId) return false;
if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
if (created != null ? !created.equals(that.created) : that.created != null) return false;
if (ipAddress != null ? !ipAddress.equals(that.ipAddress) : that.ipAddress != null) return false;
if (jobId != null ? !jobId.equals(that.jobId) : that.jobId != null) return false;
if (jobStatus != null ? !jobStatus.equals(that.jobStatus) : that.jobStatus != null) return false;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
if (path != null ? !path.equals(that.path) : that.path != null) return false;
if (podName != null ? !podName.equals(that.podName) : that.podName != null) return false;
if (state != that.state) return false;
if (tags != null ? !tags.equals(that.tags) : that.tags != null) return false;
if (type != that.type) return false;
if (zoneName != null ? !zoneName.equals(that.zoneName) : that.zoneName != null) return false;
if (!Objects.equal(clusterId, that.clusterId)) return false;
if (!Objects.equal(diskSizeAllocated, that.diskSizeAllocated)) return false;
if (!Objects.equal(diskSizeTotal, that.diskSizeTotal)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(podId, that.podId)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(clusterName, that.clusterName)) return false;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(ipAddress, that.ipAddress)) return false;
if (!Objects.equal(jobId, that.jobId)) return false;
if (!Objects.equal(jobStatus, that.jobStatus)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(path, that.path)) return false;
if (!Objects.equal(podName, that.podName)) return false;
if (!Objects.equal(state, that.state)) return false;
if (!Objects.equal(tags, that.tags)) return false;
if (!Objects.equal(type, that.type)) return false;
if (!Objects.equal(zoneName, that.zoneName)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (path != null ? path.hashCode() : 0);
result = 31 * result + (tags != null ? tags.hashCode() : 0);
result = 31 * result + (state != null ? state.hashCode() : 0);
result = 31 * result + (type != null ? type.hashCode() : 0);
result = 31 * result + (int) (zoneId ^ (zoneId >>> 32));
result = 31 * result + (zoneName != null ? zoneName.hashCode() : 0);
result = 31 * result + (int) (podId ^ (podId >>> 32));
result = 31 * result + (podName != null ? podName.hashCode() : 0);
result = 31 * result + (int) (clusterId ^ (clusterId >>> 32));
result = 31 * result + (clusterName != null ? clusterName.hashCode() : 0);
result = 31 * result + (created != null ? created.hashCode() : 0);
result = 31 * result + (int) (diskSizeAllocated ^ (diskSizeAllocated >>> 32));
result = 31 * result + (int) (diskSizeTotal ^ (diskSizeTotal >>> 32));
result = 31 * result + (ipAddress != null ? ipAddress.hashCode() : 0);
result = 31 * result + (jobId != null ? jobId.hashCode() : 0);
result = 31 * result + (jobStatus != null ? jobStatus.hashCode() : 0);
return result;
return Objects.hashCode(clusterId, diskSizeAllocated, diskSizeTotal, id, podId, zoneId,
clusterName, created, ipAddress, jobId, jobStatus, name, path,
podName, state, tags, type, zoneName);
}
@Override

View File

@ -24,6 +24,7 @@ import java.util.Date;
import javax.annotation.Nullable;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -599,142 +600,56 @@ public class Template implements Comparable<Template> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((OSType == null) ? 0 : OSType.hashCode());
result = prime * result + (int) (OSTypeId ^ (OSTypeId >>> 32));
result = prime * result + ((account == null) ? 0 : account.hashCode());
result = prime * result + (int) (accountId ^ (accountId >>> 32));
result = prime * result + (bootable ? 1231 : 1237);
result = prime * result + ((created == null) ? 0 : created.hashCode());
result = prime * result + (crossZones ? 1231 : 1237);
result = prime * result + ((displayText == null) ? 0 : displayText.hashCode());
result = prime * result + ((domain == null) ? 0 : domain.hashCode());
result = prime * result + (int) (domainId ^ (domainId >>> 32));
result = prime * result + (extractable ? 1231 : 1237);
result = prime * result + (featured ? 1231 : 1237);
result = prime * result + ((format == null) ? 0 : format.hashCode());
result = prime * result + ((hypervisor == null) ? 0 : hypervisor.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + (ispublic ? 1231 : 1237);
result = prime * result + ((jobId == null) ? 0 : jobId.hashCode());
result = prime * result + ((jobStatus == null) ? 0 : jobStatus.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + (passwordEnabled ? 1231 : 1237);
result = prime * result + (ready ? 1231 : 1237);
result = prime * result + ((removed == null) ? 0 : removed.hashCode());
result = prime * result + ((size == null) ? 0 : size.hashCode());
result = prime * result + ((status == null) ? 0 : status.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
result = prime * result + ((zone == null) ? 0 : zone.hashCode());
result = prime * result + (int) (zoneId ^ (zoneId >>> 32));
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Template that = (Template) o;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(displayText, that.displayText)) return false;
if (!Objects.equal(domain, that.domain)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(account, that.account)) return false;
if (!Objects.equal(accountId, that.accountId)) return false;
if (!Objects.equal(zone, that.zone)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(OSType, that.OSType)) return false;
if (!Objects.equal(OSTypeId, that.OSTypeId)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(type, that.type)) return false;
if (!Objects.equal(status, that.status)) return false;
if (!Objects.equal(format, that.format)) return false;
if (!Objects.equal(hypervisor, that.hypervisor)) return false;
if (!Objects.equal(size, that.size)) return false;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(removed, that.removed)) return false;
if (!Objects.equal(crossZones, that.crossZones)) return false;
if (!Objects.equal(bootable, that.bootable)) return false;
if (!Objects.equal(extractable, that.extractable)) return false;
if (!Objects.equal(featured, that.featured)) return false;
if (!Objects.equal(ispublic, that.ispublic)) return false;
if (!Objects.equal(ready, that.ready)) return false;
if (!Objects.equal(passwordEnabled, that.passwordEnabled)) return false;
if (!Objects.equal(jobId, that.jobId)) return false;
if (!Objects.equal(jobStatus, that.jobStatus)) return false;
if (!Objects.equal(checksum, that.checksum)) return false;
if (!Objects.equal(hostId, that.hostId)) return false;
if (!Objects.equal(hostName, that.hostName)) return false;
if (!Objects.equal(sourceTemplateId, that.sourceTemplateId)) return false;
if (!Objects.equal(templateTag, that.templateTag)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Template other = (Template) obj;
if (OSType == null) {
if (other.OSType != null)
return false;
} else if (!OSType.equals(other.OSType))
return false;
if (OSTypeId != other.OSTypeId)
return false;
if (account == null) {
if (other.account != null)
return false;
} else if (!account.equals(other.account))
return false;
if (accountId != other.accountId)
return false;
if (bootable != other.bootable)
return false;
if (created == null) {
if (other.created != null)
return false;
} else if (!created.equals(other.created))
return false;
if (crossZones != other.crossZones)
return false;
if (displayText == null) {
if (other.displayText != null)
return false;
} else if (!displayText.equals(other.displayText))
return false;
if (domain == null) {
if (other.domain != null)
return false;
} else if (!domain.equals(other.domain))
return false;
if (domainId != other.domainId)
return false;
if (extractable != other.extractable)
return false;
if (featured != other.featured)
return false;
if (format != other.format)
return false;
if (hypervisor == null) {
if (other.hypervisor != null)
return false;
} else if (!hypervisor.equals(other.hypervisor))
return false;
if (id != other.id)
return false;
if (ispublic != other.ispublic)
return false;
if (jobId == null) {
if (other.jobId != null)
return false;
} else if (!jobId.equals(other.jobId))
return false;
if (jobStatus == null) {
if (other.jobStatus != null)
return false;
} else if (!jobStatus.equals(other.jobStatus))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (passwordEnabled != other.passwordEnabled)
return false;
if (ready != other.ready)
return false;
if (removed == null) {
if (other.removed != null)
return false;
} else if (!removed.equals(other.removed))
return false;
if (size == null) {
if (other.size != null)
return false;
} else if (!size.equals(other.size))
return false;
if (status == null) {
if (other.status != null)
return false;
} else if (!status.equals(other.status))
return false;
if (type != other.type)
return false;
if (zone == null) {
if (other.zone != null)
return false;
} else if (!zone.equals(other.zone))
return false;
if (zoneId != other.zoneId)
return false;
return true;
public int hashCode() {
return Objects.hashCode(id, displayText, domain, domainId, account, accountId,
zone, zoneId, OSType, OSTypeId, name, type, status, format,
hypervisor, size, created, removed, crossZones, bootable,
extractable, featured, ispublic, ready, passwordEnabled,
jobId, jobStatus, checksum, hostId, hostName,
sourceTemplateId, templateTag);
}
@Override

View File

@ -300,34 +300,32 @@ public class TemplateExtraction implements Comparable<TemplateExtraction> {
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TemplateExtraction other = (TemplateExtraction) obj;
return id == other.id
&& accountId == other.accountId
&& Objects.equal(created, other.created)
&& extractId == other.extractId
&& Objects.equal(extractMode, other.extractMode)
&& Objects.equal(name, other.name)
&& Objects.equal(state, other.state)
&& Objects.equal(status, other.status)
&& Objects.equal(storageType, other.storageType)
&& uploadPercentage == other.uploadPercentage
&& Objects.equal(url, other.url)
&& zoneId == other.zoneId
&& Objects.equal(zoneName, other.zoneName);
TemplateExtraction that = (TemplateExtraction) o;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(accountId, that.accountId)) return false;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(extractId, that.extractId)) return false;
if (!Objects.equal(extractMode, that.extractMode)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(state, that.state)) return false;
if (!Objects.equal(status, that.status)) return false;
if (!Objects.equal(storageType, that.storageType)) return false;
if (!Objects.equal(uploadPercentage, that.uploadPercentage)) return false;
if (!Objects.equal(url, that.url)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(zoneName, that.zoneName)) return false;
return true;
}
@Override
public int hashCode() {
return Objects.hashCode(id, accountId, created, extractId, extractMode,
name, state, status, storageType, uploadPercentage, url, zoneId, zoneName);
return Objects.hashCode(id, accountId, created, extractId, extractMode, name, state, status, storageType, uploadPercentage, url, zoneId, zoneName);
}
@Override

View File

@ -18,6 +18,7 @@
*/
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -124,21 +125,17 @@ public class TemplatePermission implements Comparable<TemplatePermission> {
TemplatePermission that = (TemplatePermission) o;
if (domainId != that.domainId) return false;
if (id != that.id) return false;
if (isPublic != that.isPublic) return false;
if (account != null ? !account.equals(that.account) : that.account != null) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(isPublic, that.isPublic)) return false;
if (!Objects.equal(account, that.account)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (account != null ? account.hashCode() : 0);
result = 31 * result + (int) (domainId ^ (domainId >>> 32));
result = 31 * result + (isPublic ? 1 : 0);
return result;
return Objects.hashCode(domainId, id, isPublic, account);
}
@Override

View File

@ -24,6 +24,7 @@ import java.util.Date;
import java.util.Map;
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import com.google.gson.annotations.SerializedName;
@ -350,57 +351,36 @@ public class UsageRecord implements Comparable<UsageRecord> {
UsageRecord that = (UsageRecord) o;
if (accountId != that.accountId) return false;
if (domainId != that.domainId) return false;
if (id != that.id) return false;
if (isSourceNAT != that.isSourceNAT) return false;
if (Double.compare(that.rawUsageHours, rawUsageHours) != 0) return false;
if (releaseDate != that.releaseDate) return false;
if (serviceOfferingId != that.serviceOfferingId) return false;
if (templateId != that.templateId) return false;
if (virtualMachineId != that.virtualMachineId) return false;
if (zoneId != that.zoneId) return false;
if (accountName != null ? !accountName.equals(that.accountName) : that.accountName != null) return false;
if (assignDate != null ? !assignDate.equals(that.assignDate) : that.assignDate != null) return false;
if (description != null ? !description.equals(that.description) : that.description != null) return false;
if (endDate != null ? !endDate.equals(that.endDate) : that.endDate != null) return false;
if (ipAddress != null ? !ipAddress.equals(that.ipAddress) : that.ipAddress != null) return false;
if (startDate != null ? !startDate.equals(that.startDate) : that.startDate != null) return false;
if (type != null ? !type.equals(that.type) : that.type != null) return false;
if (usage != null ? !usage.equals(that.usage) : that.usage != null) return false;
if (usageType != that.usageType) return false;
if (virtualMachineName != null ? !virtualMachineName.equals(that.virtualMachineName) : that.virtualMachineName != null)
return false;
if (!Objects.equal(accountId, that.accountId)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(isSourceNAT, that.isSourceNAT)) return false;
if (!Objects.equal(rawUsageHours, that.rawUsageHours)) return false;
if (!Objects.equal(releaseDate, that.releaseDate)) return false;
if (!Objects.equal(serviceOfferingId, that.serviceOfferingId)) return false;
if (!Objects.equal(templateId, that.templateId)) return false;
if (!Objects.equal(virtualMachineId, that.virtualMachineId)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(accountName, that.accountName)) return false;
if (!Objects.equal(assignDate, that.assignDate)) return false;
if (!Objects.equal(description, that.description)) return false;
if (!Objects.equal(endDate, that.endDate)) return false;
if (!Objects.equal(ipAddress, that.ipAddress)) return false;
if (!Objects.equal(startDate, that.startDate)) return false;
if (!Objects.equal(type, that.type)) return false;
if (!Objects.equal(usage, that.usage)) return false;
if (!Objects.equal(usageType, that.usageType)) return false;
if (!Objects.equal(virtualMachineName, that.virtualMachineName)) return false;
return true;
}
@Override
public int hashCode() {
int result;
long temp;
result = (int) (id ^ (id >>> 32));
result = 31 * result + (description != null ? description.hashCode() : 0);
result = 31 * result + (int) (accountId ^ (accountId >>> 32));
result = 31 * result + (accountName != null ? accountName.hashCode() : 0);
result = 31 * result + (int) (domainId ^ (domainId >>> 32));
result = 31 * result + (startDate != null ? startDate.hashCode() : 0);
result = 31 * result + (endDate != null ? endDate.hashCode() : 0);
result = 31 * result + (assignDate != null ? assignDate.hashCode() : 0);
result = 31 * result + (int) (releaseDate ^ (releaseDate >>> 32));
result = 31 * result + (int) (zoneId ^ (zoneId >>> 32));
result = 31 * result + (int) (virtualMachineId ^ (virtualMachineId >>> 32));
result = 31 * result + (virtualMachineName != null ? virtualMachineName.hashCode() : 0);
result = 31 * result + (int) (serviceOfferingId ^ (serviceOfferingId >>> 32));
result = 31 * result + (int) (templateId ^ (templateId >>> 32));
result = 31 * result + (ipAddress != null ? ipAddress.hashCode() : 0);
result = 31 * result + (isSourceNAT ? 1 : 0);
temp = rawUsageHours != +0.0d ? Double.doubleToLongBits(rawUsageHours) : 0L;
result = 31 * result + (int) (temp ^ (temp >>> 32));
result = 31 * result + (usage != null ? usage.hashCode() : 0);
result = 31 * result + (type != null ? type.hashCode() : 0);
result = 31 * result + (usageType != null ? usageType.hashCode() : 0);
return result;
return Objects.hashCode(accountId, domainId, id, isSourceNAT, rawUsageHours, releaseDate,
serviceOfferingId, templateId, virtualMachineId, zoneId, accountName,
assignDate, description, endDate, ipAddress, startDate, type, usage,
usageType, virtualMachineName);
}
@Override

View File

@ -22,6 +22,7 @@ import java.util.Date;
import org.jclouds.cloudstack.domain.Account.Type;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -309,38 +310,26 @@ public class User implements Comparable<User> {
@Override
public int compareTo(User arg0) {
return new Long(id).compareTo(arg0.getId());
return new Long(id).compareTo(arg0.getId());
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User that = (User) o;
if (!Objects.equal(account, that.account)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(id, that.id)) return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((account == null) ? 0 : account.hashCode());
result = prime * result + (int) (domainId ^ (domainId >>> 32));
result = prime * result + (int) (id ^ (id >>> 32));
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
User other = (User) obj;
if (account == null) {
if (other.account != null)
return false;
} else if (!account.equals(other.account))
return false;
if (domainId != other.domainId)
return false;
if (id != other.id)
return false;
return true;
return Objects.hashCode(account, domainId, id);
}
@Override

View File

@ -20,6 +20,7 @@ package org.jclouds.cloudstack.domain;
import java.util.Date;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -145,27 +146,21 @@ public class VMGroup implements Comparable<VMGroup> {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
VMGroup vmGroup = (VMGroup) o;
VMGroup that = (VMGroup) o;
if (domainId != vmGroup.domainId) return false;
if (id != vmGroup.id) return false;
if (account != null ? !account.equals(vmGroup.account) : vmGroup.account != null) return false;
if (created != null ? !created.equals(vmGroup.created) : vmGroup.created != null) return false;
if (domain != null ? !domain.equals(vmGroup.domain) : vmGroup.domain != null) return false;
if (name != null ? !name.equals(vmGroup.name) : vmGroup.name != null) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(account, that.account)) return false;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(domain, that.domain)) return false;
if (!Objects.equal(name, that.name)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (account != null ? account.hashCode() : 0);
result = 31 * result + (created != null ? created.hashCode() : 0);
result = 31 * result + (domain != null ? domain.hashCode() : 0);
result = 31 * result + (int) (domainId ^ (domainId >>> 32));
result = 31 * result + (name != null ? name.hashCode() : 0);
return result;
return Objects.hashCode(domainId, id, account, created, domain, name);
}
@Override

View File

@ -26,6 +26,7 @@ import java.util.Set;
import javax.annotation.Nullable;
import com.google.common.base.CaseFormat;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet;
@ -751,209 +752,67 @@ public class VirtualMachine implements Comparable<VirtualMachine> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (HAEnabled ? 1231 : 1237);
result = prime * result + ((IPAddress == null) ? 0 : IPAddress.hashCode());
result = prime * result + ((ISODisplayText == null) ? 0 : ISODisplayText.hashCode());
result = prime * result + (int) (ISOId ^ (ISOId >>> 32));
result = prime * result + ((ISOName == null) ? 0 : ISOName.hashCode());
result = prime * result + ((account == null) ? 0 : account.hashCode());
result = prime * result + (int) (cpuCount ^ (cpuCount >>> 32));
result = prime * result + (int) (cpuSpeed ^ (cpuSpeed >>> 32));
result = prime * result + ((cpuUsed == null) ? 0 : cpuUsed.hashCode());
result = prime * result + ((created == null) ? 0 : created.hashCode());
result = prime * result + ((displayName == null) ? 0 : displayName.hashCode());
result = prime * result + ((domain == null) ? 0 : domain.hashCode());
result = prime * result + (int) (domainId ^ (domainId >>> 32));
result = prime * result + ((group == null) ? 0 : group.hashCode());
result = prime * result + (int) (groupId ^ (groupId >>> 32));
result = prime * result + (int) (guestOSId ^ (guestOSId >>> 32));
result = prime * result + (int) (hostId ^ (hostId >>> 32));
result = prime * result + ((hostname == null) ? 0 : hostname.hashCode());
result = prime * result + ((hypervisor == null) ? 0 : hypervisor.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((jobId == null) ? 0 : jobId.hashCode());
result = prime * result + ((jobStatus == null) ? 0 : jobStatus.hashCode());
result = prime * result + (int) (memory ^ (memory >>> 32));
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((networkKbsRead == null) ? 0 : networkKbsRead.hashCode());
result = prime * result + ((networkKbsWrite == null) ? 0 : networkKbsWrite.hashCode());
result = prime * result + ((nics == null) ? 0 : nics.hashCode());
result = prime * result + ((password == null) ? 0 : password.hashCode());
result = prime * result + (passwordEnabled ? 1231 : 1237);
result = prime * result + (int) (rootDeviceId ^ (rootDeviceId >>> 32));
result = prime * result + ((securityGroups == null) ? 0 : securityGroups.hashCode());
result = prime * result + (int) (serviceOfferingId ^ (serviceOfferingId >>> 32));
result = prime * result + ((serviceOfferingName == null) ? 0 : serviceOfferingName.hashCode());
result = prime * result + ((templateDisplayText == null) ? 0 : templateDisplayText.hashCode());
result = prime * result + (int) (templateId ^ (templateId >>> 32));
result = prime * result + ((templateName == null) ? 0 : templateName.hashCode());
result = prime * result + (usesVirtualNetwork ? 1231 : 1237);
result = prime * result + (int) (zoneId ^ (zoneId >>> 32));
result = prime * result + ((zoneName == null) ? 0 : zoneName.hashCode());
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
VirtualMachine that = (VirtualMachine) o;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(account, that.account)) return false;
if (!Objects.equal(cpuCount, that.cpuCount)) return false;
if (!Objects.equal(cpuSpeed, that.cpuSpeed)) return false;
if (!Objects.equal(cpuUsed, that.cpuUsed)) return false;
if (!Objects.equal(displayName, that.displayName)) return false;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(domain, that.domain)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(usesVirtualNetwork, that.usesVirtualNetwork)) return false;
if (!Objects.equal(group, that.group)) return false;
if (!Objects.equal(groupId, that.groupId)) return false;
if (!Objects.equal(guestOSId, that.guestOSId)) return false;
if (!Objects.equal(HAEnabled, that.HAEnabled)) return false;
if (!Objects.equal(hostId, that.hostId)) return false;
if (!Objects.equal(hostname, that.hostname)) return false;
if (!Objects.equal(IPAddress, that.IPAddress)) return false;
if (!Objects.equal(ISODisplayText, that.ISODisplayText)) return false;
if (!Objects.equal(ISOId, that.ISOId)) return false;
if (!Objects.equal(ISOName, that.ISOName)) return false;
if (!Objects.equal(jobId, that.jobId)) return false;
if (!Objects.equal(jobStatus, that.jobStatus)) return false;
if (!Objects.equal(memory, that.memory)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(networkKbsRead, that.networkKbsRead)) return false;
if (!Objects.equal(networkKbsWrite, that.networkKbsWrite)) return false;
if (!Objects.equal(password, that.password)) return false;
if (!Objects.equal(passwordEnabled, that.passwordEnabled)) return false;
if (!Objects.equal(rootDeviceId, that.rootDeviceId)) return false;
if (!Objects.equal(rootDeviceType, that.rootDeviceType)) return false;
if (!Objects.equal(securityGroups, that.securityGroups)) return false;
if (!Objects.equal(serviceOfferingId, that.serviceOfferingId)) return false;
if (!Objects.equal(serviceOfferingName, that.serviceOfferingName)) return false;
if (!Objects.equal(state, that.state)) return false;
if (!Objects.equal(templateDisplayText, that.templateDisplayText)) return false;
if (!Objects.equal(templateId, that.templateId)) return false;
if (!Objects.equal(templateName, that.templateName)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(zoneName, that.zoneName)) return false;
if (!Objects.equal(nics, that.nics)) return false;
if (!Objects.equal(hypervisor, that.hypervisor)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
VirtualMachine other = (VirtualMachine) obj;
if (HAEnabled != other.HAEnabled)
return false;
if (IPAddress == null) {
if (other.IPAddress != null)
return false;
} else if (!IPAddress.equals(other.IPAddress))
return false;
if (ISODisplayText == null) {
if (other.ISODisplayText != null)
return false;
} else if (!ISODisplayText.equals(other.ISODisplayText))
return false;
if (ISOId != other.ISOId)
return false;
if (ISOName == null) {
if (other.ISOName != null)
return false;
} else if (!ISOName.equals(other.ISOName))
return false;
if (account == null) {
if (other.account != null)
return false;
} else if (!account.equals(other.account))
return false;
if (cpuCount != other.cpuCount)
return false;
if (cpuSpeed != other.cpuSpeed)
return false;
if (cpuUsed == null) {
if (other.cpuUsed != null)
return false;
} else if (!cpuUsed.equals(other.cpuUsed))
return false;
if (created == null) {
if (other.created != null)
return false;
} else if (!created.equals(other.created))
return false;
if (displayName == null) {
if (other.displayName != null)
return false;
} else if (!displayName.equals(other.displayName))
return false;
if (domain == null) {
if (other.domain != null)
return false;
} else if (!domain.equals(other.domain))
return false;
if (domainId != other.domainId)
return false;
if (group == null) {
if (other.group != null)
return false;
} else if (!group.equals(other.group))
return false;
if (groupId != other.groupId)
return false;
if (guestOSId != other.guestOSId)
return false;
if (hostId != other.hostId)
return false;
if (hostname == null) {
if (other.hostname != null)
return false;
} else if (!hostname.equals(other.hostname))
return false;
if (hypervisor == null) {
if (other.hypervisor != null)
return false;
} else if (!hypervisor.equals(other.hypervisor))
return false;
if (id != other.id)
return false;
if (jobId == null) {
if (other.jobId != null)
return false;
} else if (!jobId.equals(other.jobId))
return false;
if (jobStatus == null) {
if (other.jobStatus != null)
return false;
} else if (!jobStatus.equals(other.jobStatus))
return false;
if (memory != other.memory)
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (networkKbsRead == null) {
if (other.networkKbsRead != null)
return false;
} else if (!networkKbsRead.equals(other.networkKbsRead))
return false;
if (networkKbsWrite == null) {
if (other.networkKbsWrite != null)
return false;
} else if (!networkKbsWrite.equals(other.networkKbsWrite))
return false;
if (nics == null) {
if (other.nics != null)
return false;
} else if (!nics.equals(other.nics))
return false;
if (password == null) {
if (other.password != null)
return false;
} else if (!password.equals(other.password))
return false;
if (passwordEnabled != other.passwordEnabled)
return false;
if (rootDeviceId != other.rootDeviceId)
return false;
// rootDeviceType and state are volatile
if (securityGroups == null) {
if (other.securityGroups != null)
return false;
} else if (!securityGroups.equals(other.securityGroups))
return false;
if (serviceOfferingId != other.serviceOfferingId)
return false;
if (serviceOfferingName == null) {
if (other.serviceOfferingName != null)
return false;
} else if (!serviceOfferingName.equals(other.serviceOfferingName))
return false;
if (templateDisplayText == null) {
if (other.templateDisplayText != null)
return false;
} else if (!templateDisplayText.equals(other.templateDisplayText))
return false;
if (templateId != other.templateId)
return false;
if (templateName == null) {
if (other.templateName != null)
return false;
} else if (!templateName.equals(other.templateName))
return false;
if (usesVirtualNetwork != other.usesVirtualNetwork)
return false;
if (zoneId != other.zoneId)
return false;
if (zoneName == null) {
if (other.zoneName != null)
return false;
} else if (!zoneName.equals(other.zoneName))
return false;
return true;
public int hashCode() {
return Objects.hashCode(id, account, cpuCount, cpuSpeed, cpuUsed, displayName, created,
domain, domainId, usesVirtualNetwork, group, groupId, guestOSId,
HAEnabled, hostId, hostname, IPAddress, ISODisplayText, ISOId,
ISOName, jobId, jobStatus, memory, name, networkKbsRead,
networkKbsWrite, password, passwordEnabled, rootDeviceId,
rootDeviceType, securityGroups, serviceOfferingId,
serviceOfferingName, state, templateDisplayText, templateId,
templateName, zoneId, zoneName, nics, hypervisor);
}
@Override

View File

@ -18,6 +18,7 @@
*/
package org.jclouds.cloudstack.domain;
import com.google.common.base.Objects;
import com.google.gson.annotations.SerializedName;
/**
@ -238,43 +239,30 @@ public class VlanIPRange implements Comparable<VlanIPRange> {
VlanIPRange that = (VlanIPRange) o;
if (domainId != that.domainId) return false;
if (forVirtualNetwork != that.forVirtualNetwork) return false;
if (id != that.id) return false;
if (networkId != that.networkId) return false;
if (podId != that.podId) return false;
if (zoneId != that.zoneId) return false;
if (account != null ? !account.equals(that.account) : that.account != null) return false;
if (description != null ? !description.equals(that.description) : that.description != null) return false;
if (domain != null ? !domain.equals(that.domain) : that.domain != null) return false;
if (endIP != null ? !endIP.equals(that.endIP) : that.endIP != null) return false;
if (gateway != null ? !gateway.equals(that.gateway) : that.gateway != null) return false;
if (netmask != null ? !netmask.equals(that.netmask) : that.netmask != null) return false;
if (podName != null ? !podName.equals(that.podName) : that.podName != null) return false;
if (startIP != null ? !startIP.equals(that.startIP) : that.startIP != null) return false;
if (vlan != null ? !vlan.equals(that.vlan) : that.vlan != null) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(forVirtualNetwork, that.forVirtualNetwork)) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(networkId, that.networkId)) return false;
if (!Objects.equal(podId, that.podId)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(account, that.account)) return false;
if (!Objects.equal(description, that.description)) return false;
if (!Objects.equal(domain, that.domain)) return false;
if (!Objects.equal(endIP, that.endIP)) return false;
if (!Objects.equal(gateway, that.gateway)) return false;
if (!Objects.equal(netmask, that.netmask)) return false;
if (!Objects.equal(podName, that.podName)) return false;
if (!Objects.equal(startIP, that.startIP)) return false;
if (!Objects.equal(vlan, that.vlan)) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (description != null ? description.hashCode() : 0);
result = 31 * result + (forVirtualNetwork ? 1 : 0);
result = 31 * result + (int) (zoneId ^ (zoneId >>> 32));
result = 31 * result + (vlan != null ? vlan.hashCode() : 0);
result = 31 * result + (account != null ? account.hashCode() : 0);
result = 31 * result + (int) (domainId ^ (domainId >>> 32));
result = 31 * result + (domain != null ? domain.hashCode() : 0);
result = 31 * result + (int) (podId ^ (podId >>> 32));
result = 31 * result + (podName != null ? podName.hashCode() : 0);
result = 31 * result + (gateway != null ? gateway.hashCode() : 0);
result = 31 * result + (netmask != null ? netmask.hashCode() : 0);
result = 31 * result + (startIP != null ? startIP.hashCode() : 0);
result = 31 * result + (endIP != null ? endIP.hashCode() : 0);
result = 31 * result + (int) (networkId ^ (networkId >>> 32));
return result;
return Objects.hashCode(domainId, forVirtualNetwork, id, networkId, podId,
zoneId, account, description, domain, endIP, gateway,
netmask, podName, startIP, vlan);
}
@Override

View File

@ -26,6 +26,7 @@ import java.util.Map;
import com.google.common.base.CaseFormat;
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import com.google.gson.annotations.SerializedName;
@ -468,86 +469,51 @@ public class Volume implements Comparable<Volume> {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Volume volume = (Volume) o;
Volume that = (Volume) o;
if (deviceId != volume.deviceId) return false;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(account, that.account)) return false;
if (!Objects.equal(attached, that.attached)) return false;
if (!Objects.equal(created, that.created)) return false;
if (!Objects.equal(destroyed, that.destroyed)) return false;
if (!Objects.equal(deviceId, that.deviceId)) return false;
if (!Objects.equal(diskOfferingDisplayText, that.diskOfferingDisplayText)) return false;
if (!Objects.equal(diskOfferingId, that.diskOfferingId)) return false;
if (!Objects.equal(diskOfferingName, that.diskOfferingName)) return false;
if (!Objects.equal(domain, that.domain)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(hypervisor, that.hypervisor)) return false;
if (!Objects.equal(isExtractable, that.isExtractable)) return false;
if (!Objects.equal(jobId, that.jobId)) return false;
if (!Objects.equal(jobStatus, that.jobStatus)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(serviceOfferingDisplayText, that.serviceOfferingDisplayText)) return false;
if (!Objects.equal(serviceOfferingId, that.serviceOfferingId)) return false;
if (!Objects.equal(serviceOfferingName, that.serviceOfferingName)) return false;
if (!Objects.equal(size, that.size)) return false;
if (!Objects.equal(snapshotId, that.snapshotId)) return false;
if (!Objects.equal(state, that.state)) return false;
if (!Objects.equal(storage, that.storage)) return false;
if (!Objects.equal(storageType, that.storageType)) return false;
if (!Objects.equal(type, that.type)) return false;
if (!Objects.equal(virtualMachineId, that.virtualMachineId)) return false;
if (!Objects.equal(vmDisplayName, that.vmDisplayName)) return false;
if (!Objects.equal(vmName, that.vmName)) return false;
if (!Objects.equal(vmState, that.vmState)) return false;
if (!Objects.equal(zoneId, that.zoneId)) return false;
if (!Objects.equal(zoneName, that.zoneName)) return false;
if (diskOfferingId != volume.diskOfferingId) return false;
if (domainId != volume.domainId) return false;
if (id != volume.id) return false;
if (isExtractable != volume.isExtractable) return false;
if (jobId != volume.jobId) return false;
if (serviceOfferingId != volume.serviceOfferingId) return false;
if (size != volume.size) return false;
if (snapshotId != volume.snapshotId) return false;
if (virtualMachineId != volume.virtualMachineId) return false;
if (zoneId != volume.zoneId) return false;
if (attached != null ? !attached.equals(volume.attached) : volume.attached != null) return false;
if (!created.equals(volume.created)) return false;
if (diskOfferingDisplayText != null ? !diskOfferingDisplayText.equals(volume.diskOfferingDisplayText) :
volume.diskOfferingDisplayText != null)
return false;
if (diskOfferingName != null ? !diskOfferingName.equals(volume.diskOfferingName) : volume.diskOfferingName != null)
return false;
if (!domain.equals(volume.domain)) return false;
if (hypervisor != null ? !hypervisor.equals(volume.hypervisor) : volume.hypervisor != null) return false;
if (jobStatus != null ? !jobStatus.equals(volume.jobStatus) : volume.jobStatus != null) return false;
if (name != null ? !name.equals(volume.name) : volume.name != null) return false;
if (serviceOfferingDisplayText != null ? !serviceOfferingDisplayText.equals(volume.serviceOfferingDisplayText) :
volume.serviceOfferingDisplayText != null)
return false;
if (serviceOfferingName != null ? !serviceOfferingName.equals(volume.serviceOfferingName) :
volume.serviceOfferingName != null)
return false;
if (state != null ? !state.equals(volume.state) : volume.state != null) return false;
if (storage != null ? !storage.equals(volume.storage) : volume.storage != null) return false;
if (storageType != null ? !storageType.equals(volume.storageType) : volume.storageType != null) return false;
if (type != null ? !type.equals(volume.type) : volume.type != null) return false;
if (vmDisplayName != null ? !vmDisplayName.equals(volume.vmDisplayName) : volume.vmDisplayName != null)
return false;
if (vmName != null ? !vmName.equals(volume.vmName) : volume.vmName != null) return false;
if (vmState != volume.vmState) return false;
if (zoneName != null ? !zoneName.equals(volume.zoneName) : volume.zoneName != null) return false;
if (account == null) {
if (volume.account != null)
return false;
} else if (!account.equals(volume.account))
return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (attached != null ? attached.hashCode() : 0);
result = 31 * result + created.hashCode();
result = 31 * result + (int) (deviceId ^ (deviceId >>> 32));
result = 31 * result + (diskOfferingDisplayText != null ? diskOfferingDisplayText.hashCode() : 0);
result = 31 * result + (int) (diskOfferingId ^ (diskOfferingId >>> 32));
result = 31 * result + (diskOfferingName != null ? diskOfferingName.hashCode() : 0);
result = 31 * result + domain.hashCode();
result = 31 * result + (int) (domainId ^ (domainId >>> 32));
result = 31 * result + (hypervisor != null ? hypervisor.hashCode() : 0);
result = 31 * result + (isExtractable ? 1 : 0);
result = 31 * result + (int) (jobId ^ (jobId >>> 32));
result = 31 * result + (jobStatus != null ? jobStatus.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (serviceOfferingDisplayText != null ? serviceOfferingDisplayText.hashCode() : 0);
result = 31 * result + (int) (serviceOfferingId ^ (serviceOfferingId >>> 32));
result = 31 * result + (serviceOfferingName != null ? serviceOfferingName.hashCode() : 0);
result = 31 * result + (int) (size ^ (size >>> 32));
result = 31 * result + (int) (snapshotId ^ (snapshotId >>> 32));
result = 31 * result + (state != null ? state.hashCode() : 0);
result = 31 * result + (storage != null ? storage.hashCode() : 0);
result = 31 * result + (storageType != null ? storageType.hashCode() : 0);
result = 31 * result + (type != null ? type.hashCode() : 0);
result = 31 * result + (int) (virtualMachineId ^ (virtualMachineId >>> 32));
result = 31 * result + (vmDisplayName != null ? vmDisplayName.hashCode() : 0);
result = 31 * result + (vmName != null ? vmName.hashCode() : 0);
result = 31 * result + (vmState != null ? vmState.hashCode() : 0);
result = 31 * result + (int) (zoneId ^ (zoneId >>> 32));
result = 31 * result + (zoneName != null ? zoneName.hashCode() : 0);
return result;
return Objects.hashCode(id, account, attached, created, destroyed, deviceId, diskOfferingDisplayText,
diskOfferingId, diskOfferingName, domain, domainId, hypervisor,
isExtractable, jobId, jobStatus, name, serviceOfferingDisplayText,
serviceOfferingId, serviceOfferingName, size, snapshotId, state, storage,
storageType, type, virtualMachineId, vmDisplayName, vmName, vmState, zoneId,
zoneName);
}
@Override

View File

@ -24,6 +24,7 @@ import java.util.List;
import javax.annotation.Nullable;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.gson.annotations.SerializedName;
@ -313,103 +314,39 @@ public class Zone implements Comparable<Zone> {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((DNS1 == null) ? 0 : DNS1.hashCode());
result = prime * result + ((DNS2 == null) ? 0 : DNS2.hashCode());
result = prime * result + ((VLAN == null) ? 0 : VLAN.hashCode());
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + ((displayText == null) ? 0 : displayText.hashCode());
result = prime * result + ((domain == null) ? 0 : domain.hashCode());
result = prime * result + (int) (domainId ^ (domainId >>> 32));
result = prime * result + ((guestCIDRAddress == null) ? 0 : guestCIDRAddress.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((internalDNS1 == null) ? 0 : internalDNS1.hashCode());
result = prime * result + ((internalDNS2 == null) ? 0 : internalDNS2.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((allocationState == null) ? 0 : allocationState.hashCode());
result = prime * result + ((networkType == null) ? 0 : networkType.hashCode());
result = prime * result + (securityGroupsEnabled ? 1231 : 1237);
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Zone that = (Zone) o;
if (!Objects.equal(id, that.id)) return false;
if (!Objects.equal(description, that.description)) return false;
if (!Objects.equal(displayText, that.displayText)) return false;
if (!Objects.equal(DNS1, that.DNS1)) return false;
if (!Objects.equal(DNS2, that.DNS2)) return false;
if (!Objects.equal(domain, that.domain)) return false;
if (!Objects.equal(domainId, that.domainId)) return false;
if (!Objects.equal(guestCIDRAddress, that.guestCIDRAddress)) return false;
if (!Objects.equal(internalDNS1, that.internalDNS1)) return false;
if (!Objects.equal(internalDNS2, that.internalDNS2)) return false;
if (!Objects.equal(name, that.name)) return false;
if (!Objects.equal(networkType, that.networkType)) return false;
if (!Objects.equal(VLAN, that.VLAN)) return false;
if (!Objects.equal(securityGroupsEnabled, that.securityGroupsEnabled)) return false;
if (!Objects.equal(allocationState, that.allocationState)) return false;
if (!Objects.equal(dhcpProvider, that.dhcpProvider)) return false;
if (!Objects.equal(zoneToken, that.zoneToken)) return false;
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Zone other = (Zone) obj;
if (DNS1 == null) {
if (other.DNS1 != null)
return false;
} else if (!DNS1.equals(other.DNS1))
return false;
if (DNS2 == null) {
if (other.DNS2 != null)
return false;
} else if (!DNS2.equals(other.DNS2))
return false;
if (VLAN == null) {
if (other.VLAN != null)
return false;
} else if (!VLAN.equals(other.VLAN))
return false;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (allocationState == null) {
if (other.allocationState != null)
return false;
} else if (!allocationState.equals(other.allocationState))
return false;
if (displayText == null) {
if (other.displayText != null)
return false;
} else if (!displayText.equals(other.displayText))
return false;
if (domain == null) {
if (other.domain != null)
return false;
} else if (!domain.equals(other.domain))
return false;
if (domainId != other.domainId)
return false;
if (guestCIDRAddress == null) {
if (other.guestCIDRAddress != null)
return false;
} else if (!guestCIDRAddress.equals(other.guestCIDRAddress))
return false;
if (id != other.id)
return false;
if (internalDNS1 == null) {
if (other.internalDNS1 != null)
return false;
} else if (!internalDNS1.equals(other.internalDNS1))
return false;
if (internalDNS2 == null) {
if (other.internalDNS2 != null)
return false;
} else if (!internalDNS2.equals(other.internalDNS2))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (networkType == null) {
if (other.networkType != null)
return false;
} else if (!networkType.equals(other.networkType))
return false;
if (securityGroupsEnabled != other.securityGroupsEnabled)
return false;
return true;
public int hashCode() {
return Objects.hashCode(id, description, displayText, DNS1, DNS2, domain, domainId,
guestCIDRAddress, internalDNS1, internalDNS2, name, networkType, VLAN,
securityGroupsEnabled, allocationState, dhcpProvider,
zoneToken);
}
@Override