use of org.apache.commons.lang.builder.EqualsBuilder in project symmetric-ds by JumpMind.
the class ForeignKey method equals.
/**
* {@inheritDoc}
*/
public boolean equals(Object obj) {
if (obj instanceof ForeignKey) {
ForeignKey otherFk = (ForeignKey) obj;
// Note that this compares case sensitive
// Note also that we can simply compare the references regardless of
// their order
// (which is irrelevant for fks) because they are contained in a set
EqualsBuilder builder = new EqualsBuilder();
if (isCheckName(otherFk)) {
builder.append(name, otherFk.name);
}
builder.append(foreignTableName, otherFk.foreignTableName);
builder.append(references.size(), otherFk.references.size());
for (int i = 0; i < references.size() && i < otherFk.references.size(); i++) {
builder.append(references.get(i), otherFk.references.get(i));
}
return builder.isEquals();
} else {
return false;
}
}
use of org.apache.commons.lang.builder.EqualsBuilder in project commons by twitter.
the class ZooKeeperClient method credentials.
/**
* Creates a set of credentials for the given authentication {@code scheme}.
*
* @param scheme the scheme to authenticate with
* @param authToken the authentication token
* @return a set of credentials that can be used to authenticate the zoo keeper client
*/
public static Credentials credentials(final String scheme, final byte[] authToken) {
MorePreconditions.checkNotBlank(scheme);
Preconditions.checkNotNull(authToken);
return new Credentials() {
@Override
public void authenticate(ZooKeeper zooKeeper) {
zooKeeper.addAuthInfo(scheme, authToken);
}
@Override
public String scheme() {
return scheme;
}
@Override
public byte[] authToken() {
return authToken;
}
@Override
public boolean equals(Object o) {
if (!(o instanceof Credentials)) {
return false;
}
Credentials other = (Credentials) o;
return new EqualsBuilder().append(scheme, other.scheme()).append(authToken, other.authToken()).isEquals();
}
@Override
public int hashCode() {
return Objects.hashCode(scheme, authToken);
}
};
}
use of org.apache.commons.lang.builder.EqualsBuilder in project rest.li by linkedin.
the class BatchingKey method equals.
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || !(o instanceof BatchingKey))
return false;
@SuppressWarnings("unchecked") BatchingKey<T, R> that = (BatchingKey<T, R>) o;
EqualsBuilder builder = new EqualsBuilder();
builder.append(_request.getBaseUriTemplate(), that._request.getBaseUriTemplate());
builder.append(_request.getPathKeys(), that._request.getPathKeys());
builder.append(_request.getResourceProperties(), that._request.getResourceProperties());
builder.append(_request.getRequestOptions(), that._request.getRequestOptions());
builder.append(_queryParams, that._queryParams);
builder.append(_batchFields, that._batchFields);
if (_batchFields)
builder.append(_request.getFields(), that._request.getFields());
return builder.isEquals();
}
use of org.apache.commons.lang.builder.EqualsBuilder in project gora by apache.
the class QueryWSBase method equals.
@SuppressWarnings({ "rawtypes" })
@Override
public /**
* Determines if this object is equal to a different one
*/
boolean equals(Object obj) {
if (obj instanceof QueryWSBase) {
QueryWSBase that = (QueryWSBase) obj;
EqualsBuilder builder = new EqualsBuilder();
builder.append(dataStore, that.dataStore);
builder.append(queryString, that.queryString);
builder.append(fields, that.fields);
builder.append(startKey, that.startKey);
builder.append(endKey, that.endKey);
builder.append(filter, that.filter);
builder.append(limit, that.limit);
return builder.isEquals();
}
return false;
}
use of org.apache.commons.lang.builder.EqualsBuilder in project pentaho-platform by pentaho.
the class PentahoUser method equals.
public boolean equals(Object obj) {
if (obj instanceof PentahoUser == false) {
return false;
}
if (this == obj) {
return true;
}
PentahoUser rhs = (PentahoUser) obj;
boolean result;
if ((getTenant() == null) && (rhs.getTenant() == null)) {
result = new EqualsBuilder().append(username, rhs.username).isEquals();
} else {
result = new EqualsBuilder().append(username, rhs.username).append(tenant, rhs.tenant).isEquals();
}
return result;
}
Aggregations