use of org.apache.commons.lang.builder.EqualsBuilder in project candlepin by candlepin.
the class Content method equals.
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other instanceof Content) {
Content that = (Content) other;
boolean equals = new EqualsBuilder().append(this.id, that.id).append(this.type, that.type).append(this.label, that.label).append(this.name, that.name).append(this.vendor, that.vendor).append(this.contentUrl, that.contentUrl).append(this.requiredTags, that.requiredTags).append(this.releaseVer, that.releaseVer).append(this.gpgUrl, that.gpgUrl).append(this.metadataExpire, that.metadataExpire).append(this.arches, that.arches).append(this.locked, that.locked).isEquals();
if (equals) {
if (!Util.collectionsAreEqual(this.modifiedProductIds, that.modifiedProductIds)) {
return false;
}
}
return equals;
}
return false;
}
use of org.apache.commons.lang.builder.EqualsBuilder in project candlepin by candlepin.
the class ActivationKey method equals.
/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
boolean equals = false;
if (obj instanceof ActivationKey && super.equals(obj)) {
ActivationKey that = (ActivationKey) obj;
// Pull the owner IDs, as we're not interested in verifying that the owners
// themselves are equal; just so long as they point to the same owner.
String thisOwnerId = this.getOwner() != null ? this.getOwner().getId() : null;
String thatOwnerId = that.getOwner() != null ? that.getOwner().getId() : null;
equals = new EqualsBuilder().append(this.getId(), that.getId()).append(this.getName(), that.getName()).append(this.getDescription(), that.getDescription()).append(thisOwnerId, thatOwnerId).append(this.getReleaseVer(), that.getReleaseVer()).append(this.getServiceLevel(), that.getServiceLevel()).append(this.isAutoAttach(), that.isAutoAttach()).isEquals();
equals = equals && Util.collectionsAreEqual(this.getPools(), that.getPools(), new Comparator<ActivationKeyPool>() {
public int compare(ActivationKeyPool akp1, ActivationKeyPool akp2) {
return akp1 == akp2 || (akp1 != null && akp1.equals(akp2)) ? 0 : 1;
}
});
equals = equals && Util.collectionsAreEqual(this.getProducts(), that.getProducts(), new Comparator<Product>() {
public int compare(Product prod1, Product prod2) {
return prod1 == prod2 || (prod1 != null && prod1.equals(prod2)) ? 0 : 1;
}
});
return equals;
}
return false;
}
use of org.apache.commons.lang.builder.EqualsBuilder in project candlepin by candlepin.
the class ContentData method equals.
@Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof ContentData)) {
return false;
}
if (obj == this) {
return true;
}
ContentData that = (ContentData) obj;
EqualsBuilder builder = new EqualsBuilder().append(this.uuid, that.uuid).append(this.id, that.id).append(this.type, that.type).append(this.label, that.label).append(this.name, that.name).append(this.vendor, that.vendor).append(this.contentUrl, that.contentUrl).append(this.requiredTags, that.requiredTags).append(this.releaseVer, that.releaseVer).append(this.gpgUrl, that.gpgUrl).append(this.metadataExpire, that.metadataExpire).append(this.modifiedProductIds, that.modifiedProductIds).append(this.arches, that.arches).append(this.locked, that.locked);
return super.equals(obj) && builder.isEquals();
}
use of org.apache.commons.lang.builder.EqualsBuilder in project ovirt-engine by oVirt.
the class DisplayInterfaceEqualityPredicate method test.
@Override
public boolean test(VdsNetworkInterface otherIface) {
if (iface == otherIface) {
return true;
}
if (otherIface == null) {
return false;
}
// at this stage both of the objects are not null
EqualsBuilder eb = new EqualsBuilder();
eb.append(iface.getName(), otherIface.getName());
eb.append(iface.getIpv4Address(), otherIface.getIpv4Address());
return eb.isEquals();
}
use of org.apache.commons.lang.builder.EqualsBuilder in project vladmihalcea.wordpress.com by vladmihalcea.
the class Importer method equals.
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Importer)) {
return false;
}
Importer that = (Importer) obj;
EqualsBuilder eb = new EqualsBuilder();
eb.append(name, that.getName());
return eb.isEquals();
}
Aggregations