Java Code Examples for org.apache.commons.lang.builder.EqualsBuilder#isEquals()

The following examples show how to use org.apache.commons.lang.builder.EqualsBuilder#isEquals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TherapeuticLinkRequestType.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
public boolean equals(Object obj) {
   if (obj == null) {
      return false;
   } else if (!(obj instanceof TherapeuticLinkRequestType)) {
      return false;
   } else if (obj == this) {
      return true;
   } else {
      TherapeuticLinkRequestType other = (TherapeuticLinkRequestType)obj;
      EqualsBuilder builder = new EqualsBuilder();
      builder.append(this.link, other.link);
      builder.append(this.proofs, other.proofs);
      builder.append(this.author, other.author);
      builder.append(this.requestDate, other.requestDate);
      builder.append(this.externalId, other.externalId);
      return builder.isEquals();
   }
}
 
Example 2
Source File: TherapeuticLink.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
public boolean equals(Object obj) {
   if (obj == null) {
      return false;
   } else if (!(obj instanceof TherapeuticLink)) {
      return false;
   } else if (obj == this) {
      return true;
   } else {
      TherapeuticLink other = (TherapeuticLink)obj;
      EqualsBuilder builder = new EqualsBuilder();
      builder.append(this.comment, other.comment);
      builder.append(this.endDate, other.endDate);
      builder.append(this.hcParty, other.hcParty);
      builder.append(this.patient, other.patient);
      builder.append(this.startDate, other.startDate);
      builder.append(this.status, other.status);
      return builder.isEquals();
   }
}
 
Example 3
Source File: TherapeuticLink.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
public boolean equals(Object obj) {
   if (obj == null) {
      return false;
   } else if (!(obj instanceof TherapeuticLink)) {
      return false;
   } else if (obj == this) {
      return true;
   } else {
      TherapeuticLink other = (TherapeuticLink)obj;
      EqualsBuilder builder = new EqualsBuilder();
      builder.append(this.comment, other.comment);
      builder.append(this.endDate, other.endDate);
      builder.append(this.hcParty, other.hcParty);
      builder.append(this.patient, other.patient);
      builder.append(this.startDate, other.startDate);
      builder.append(this.status, other.status);
      return builder.isEquals();
   }
}
 
Example 4
Source File: TherapeuticLinkRequestType.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
public boolean equals(Object obj) {
   if (obj == null) {
      return false;
   } else if (!(obj instanceof TherapeuticLinkRequestType)) {
      return false;
   } else if (obj == this) {
      return true;
   } else {
      TherapeuticLinkRequestType other = (TherapeuticLinkRequestType)obj;
      EqualsBuilder builder = new EqualsBuilder();
      builder.append(this.link, other.link);
      builder.append(this.proofs, other.proofs);
      builder.append(this.author, other.author);
      builder.append(this.requestDate, other.requestDate);
      builder.append(this.externalId, other.externalId);
      return builder.isEquals();
   }
}
 
Example 5
Source File: RyaType.java    From rya with Apache License 2.0 6 votes vote down vote up
/**
 * Determine equality based on string representations of data, datatype, and
 * language.
 * @param o The object to compare with
 * @return {@code true} if the other object is also a RyaType and the data,
 * datatype, and language all match.
 */
@Override
public boolean equals(final Object o) {
    if (this == o) {
        return true;
    }
    if (o == null || !(o instanceof RyaType)) {
        return false;
    }
    final RyaType other = (RyaType) o;
    final EqualsBuilder builder = new EqualsBuilder()
            .append(getData(), other.getData())
            .append(getDataType(), other.getDataType())
            .append(getLanguage(), other.getLanguage());
    return builder.isEquals();
}
 
Example 6
Source File: TherapeuticLinkRequestType.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
public boolean equals(Object obj) {
   if (obj == null) {
      return false;
   } else if (!(obj instanceof TherapeuticLinkRequestType)) {
      return false;
   } else if (obj == this) {
      return true;
   } else {
      TherapeuticLinkRequestType other = (TherapeuticLinkRequestType)obj;
      EqualsBuilder builder = new EqualsBuilder();
      builder.append(this.link, other.link);
      builder.append(this.proofs, other.proofs);
      builder.append(this.author, other.author);
      builder.append(this.requestDate, other.requestDate);
      builder.append(this.externalId, other.externalId);
      return builder.isEquals();
   }
}
 
Example 7
Source File: OperationContext.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
public boolean equals(Object obj) {
   if (obj == null) {
      return false;
   } else if (!(obj instanceof OperationContext)) {
      return false;
   } else if (obj == this) {
      return true;
   } else {
      OperationContext other = (OperationContext)obj;
      EqualsBuilder builder = new EqualsBuilder();
      builder.append(this.operation, other.operation);
      builder.append(this.author, other.author);
      builder.append(this.proofs, other.proofs);
      builder.append(this.recordDate, other.recordDate);
      return builder.isEquals();
   }
}
 
Example 8
Source File: ImmutableAuthentication.java    From cas4.0.x-server-wechat with Apache License 2.0 6 votes vote down vote up
@Override
public boolean equals(final Object obj) {
    if (!(obj instanceof Authentication)) {
        return false;
    }
    if (obj == this) {
        return true;
    }
    final Authentication other = (Authentication) obj;
    final EqualsBuilder builder = new EqualsBuilder();
    builder.append(this.principal, other.getPrincipal());
    builder.append(this.credentials, other.getCredentials());
    builder.append(this.successes, other.getSuccesses());
    builder.append(this.authenticatedDate, other.getAuthenticatedDate().getTime());
    builder.append(wrap(this.attributes), other.getAttributes());
    builder.append(wrap(this.failures), other.getFailures());
    return builder.isEquals();
}
 
Example 9
Source File: ReplacerMojoTest.java    From maven-replacer-plugin with MIT License 5 votes vote down vote up
private BaseMatcher<List<Replacement>> replacementOf(final String xpath, final String value, 
		final boolean unescape, final String... tokens) {
	return new BaseMatcher<List<Replacement>>() {
		@SuppressWarnings("unchecked")
		public boolean matches(Object arg0) {
			List<Replacement> replacements = (List<Replacement>) arg0;
			for (int i=0; i < tokens.length; i++) {
				Replacement replacement = replacements.get(i);
				EqualsBuilder equalsBuilder = new EqualsBuilder();
				equalsBuilder.append(tokens[i], replacement.getToken());
				equalsBuilder.append(value, replacement.getValue());
				equalsBuilder.append(unescape, replacement.isUnescape());
				equalsBuilder.append(xpath, replacement.getXpath());
				
				boolean equals = equalsBuilder.isEquals();
				if (!equals) {
					return false;
				}
			}
			return true;
		}

		public void describeTo(Description desc) {
			desc.appendText("tokens").appendValue(Arrays.asList(tokens));
			desc.appendText("value").appendValue(value);
			desc.appendText("unescape").appendValue(unescape);
		}
	};
}
 
Example 10
Source File: Product.java    From vladmihalcea.wordpress.com with Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (!(obj instanceof Product)) {
        return false;
    }
    Product that = (Product) obj;
    EqualsBuilder eb = new EqualsBuilder();
    eb.append(name, that.getName());
    eb.append(company, that.getCompany());
    return eb.isEquals();
}
 
Example 11
Source File: Company.java    From vladmihalcea.wordpress.com with Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (!(obj instanceof Company)) {
        return false;
    }
    Company that = (Company) obj;
    EqualsBuilder eb = new EqualsBuilder();
    eb.append(name, that.name);
    return eb.isEquals();
}
 
Example 12
Source File: TaggedMetric.java    From timely with Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object obj) {
    if (obj == null || !(obj instanceof TaggedMetric)) {
        return false;
    }
    TaggedMetric o = (TaggedMetric) obj;
    EqualsBuilder eb = new EqualsBuilder();
    eb.append(this.columnVisibility.toString(), o.columnVisibility.toString());
    eb.append(this.orderedTags, o.orderedTags);
    return eb.isEquals();
}
 
Example 13
Source File: ActionListAction.java    From rice with Educational Community License v2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (!(o instanceof PartitionKey)) {
        return false;
    }
    PartitionKey key = (PartitionKey) o;
    EqualsBuilder builder = new EqualsBuilder();
    builder.append(applicationId, key.applicationId);
    builder.append(customActionListAttributeNames, key.customActionListAttributeNames);
    return builder.isEquals();
}
 
Example 14
Source File: Proof.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
public boolean equals(Object obj) {
   if (obj == null) {
      return false;
   } else if (!(obj instanceof Proof)) {
      return false;
   } else if (obj == this) {
      return true;
   } else {
      Proof other = (Proof)obj;
      EqualsBuilder builder = new EqualsBuilder();
      builder.append(this.binaryProof, this.binaryProof);
      builder.append(this.type, other.type);
      return builder.isEquals();
   }
}
 
Example 15
Source File: BagLeaf.java    From vladmihalcea.wordpress.com with Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (!(obj instanceof BagLeaf)) {
        return false;
    }
    BagLeaf that = (BagLeaf) obj;
    EqualsBuilder eb = new EqualsBuilder();
    eb.append(index, that.index);
    return eb.isEquals();
}
 
Example 16
Source File: Subscriber.java    From olat with Apache License 2.0 5 votes vote down vote up
/**
 * An Identity has a single subscriber.
 */
@Override
public boolean equals(final Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof Subscriber))
        return false;
    Subscriber theOther = (Subscriber) obj;
    EqualsBuilder builder = new EqualsBuilder();
    builder.append(this.getIdentity().getName(), theOther.getIdentity().getName());

    return builder.isEquals();
}
 
Example 17
Source File: MergeParentMetadata.java    From rya with Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(final Object obj) {
    if(!(obj instanceof MergeParentMetadata)) {
        return false;
    }
    final MergeParentMetadata other = (MergeParentMetadata) obj;
    final EqualsBuilder builder = new EqualsBuilder()
        .append(getRyaInstanceName(), other.getRyaInstanceName())
        .append(getTimestamp(), other.getTimestamp())
        .append(getFilterTimestamp(), other.getFilterTimestamp())
        .append(getParentTimeOffset(), other.getParentTimeOffset());
    return builder.isEquals();
}
 
Example 18
Source File: QueryCacheKey.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object object) {
	if ((object == null) || !(object instanceof QueryCacheKey)) {
		return false;
	}
	
	QueryCacheKey otherCacheKey = (QueryCacheKey) object;
	
	EqualsBuilder builder = new EqualsBuilder();
	builder.append(parameterValuesAsString, otherCacheKey.parameterValuesAsString);
	return builder.isEquals();
}
 
Example 19
Source File: CardinalityScanner.java    From datawave with Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object obj) {
    
    CardinalityIntersectionRecord other = null;
    if (obj instanceof CardinalityIntersectionRecord) {
        other = (CardinalityIntersectionRecord) obj;
    } else {
        return false;
    }
    EqualsBuilder builder = new EqualsBuilder();
    builder.append(this.date, other.date);
    builder.append(this.datatype, other.datatype);
    builder.append(this.tuple, other.tuple);
    return builder.isEquals();
}
 
Example 20
Source File: TokenPackage.java    From spacewalk with GNU General Public License v2.0 5 votes vote down vote up
/**
 *
 * {@inheritDoc}
 */
public boolean equals(Object other) {

    if (!(other instanceof TokenPackage)) {
        return false;
    }
    TokenPackage otherPack = (TokenPackage) other;

    EqualsBuilder builder = new EqualsBuilder();
    builder.append(getToken(), otherPack.getToken());
    builder.append(getPackageName(), otherPack.getPackageName());
    builder.append(getPackageArch(), otherPack.getPackageArch());

    return builder.isEquals();
}