Java Code Examples for org.apache.commons.lang.builder.EqualsBuilder

The following examples show how to use org.apache.commons.lang.builder.EqualsBuilder. These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: amazon-ecs-plugin   Source File: ECSTaskTemplateTest.java    License: MIT License 6 votes vote down vote up
@Test
public void shouldMerge() throws Exception {

    ECSTaskTemplate parent = getParent();
    ECSTaskTemplate child = getChild("parent");

    ECSTaskTemplate expected = new ECSTaskTemplate(
        "child-name", "child-label",
        null, null, "child-image", "child-repository-credentials", "EC2", "child-network-mode", "child-remoteFSRoot",
        false, null, 0, 0, 0, null, null, false, false,
        "child-containerUser", null, null, null, null, null, null, null, null, null, 0);


    ECSTaskTemplate result = child.merge(parent);
    assertTrue(EqualsBuilder.reflectionEquals(expected, result));
}
 
Example 2
@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }

    if (o == null || getClass() != o.getClass()) {
        return false;
    }

    ShortcutCreationDTO that = (ShortcutCreationDTO) o;

    return new EqualsBuilder()
            .append(name, that.name)
            .append(category, that.category)
            .append(description, that.description)
            .append(icon, that.icon)
            .append(miniature, that.miniature)
            .append(executable, that.executable)
            .isEquals();
}
 
Example 3
@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }

    if (o == null || getClass() != o.getClass()) {
        return false;
    }

    TeeRepository that = (TeeRepository) o;

    return new EqualsBuilder()
            .append(leftRepository, that.leftRepository)
            .append(rightRepository, that.rightRepository)
            .isEquals();
}
 
Example 4
Source Project: phoenicis   Source File: EngineDTO.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }

    if (o == null || getClass() != o.getClass()) {
        return false;
    }

    EngineDTO engineDTO = (EngineDTO) o;

    return new EqualsBuilder()
            .append(category, engineDTO.category)
            .append(subCategory, engineDTO.subCategory)
            .append(version, engineDTO.version)
            .append(userData, engineDTO.userData)
            .isEquals();
}
 
Example 5
Source Project: cougar   Source File: Foo.java    License: Apache License 2.0 6 votes vote down vote up
public boolean equals(Object o) {
    if (!(o instanceof Foo)) {
        return false;
    }

    if (this == o) {
        return true;
    }
    Foo another = (Foo)o;

    return new EqualsBuilder()
        .append(fooName, another.fooName)
        .append(bar, another.bar)
        .append(barBazMap, another.barBazMap)
        .append(primitiveArray, another.primitiveArray)
        .isEquals();
}
 
Example 6
/**
 * Overridden so that group by statement can be easily implemented.
 * <li>DO NOT REMOVE this method, it is critical to reconciliation process</li>
 * 
 * @see java.lang.Object#equals(java.lang.Object)
 */
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (obj == null || !PurapAccountRevisionGroup.class.isAssignableFrom(obj.getClass())) {
        return false;
    }
    PurapAccountRevisionGroup test = (PurapAccountRevisionGroup) obj;
    EqualsBuilder equalsBuilder = new EqualsBuilder();
    equalsBuilder.append(this.postingYear, test.getPostingYear());
    equalsBuilder.append(itemIdentifier, test.getItemIdentifier());
    equalsBuilder.append(replaceFiller(chartOfAccountsCode), replaceFiller(test.getChartOfAccountsCode()));
    equalsBuilder.append(replaceFiller(accountNumber), replaceFiller(test.getAccountNumber()));
    equalsBuilder.append(replaceFiller(subAccountNumber), replaceFiller(test.getSubAccountNumber()));
    equalsBuilder.append(replaceFiller(financialObjectCode), replaceFiller(test.getFinancialObjectCode()));
    equalsBuilder.append(replaceFiller(financialSubObjectCode), replaceFiller(test.getFinancialSubObjectCode()));
    equalsBuilder.append(replaceFiller(postingPeriodCode), replaceFiller(test.getPostingPeriodCode()));
    equalsBuilder.append(replaceFiller(projectCode), replaceFiller(test.getProjectCode()));
    equalsBuilder.append(replaceFiller(organizationReferenceId), replaceFiller(test.getOrganizationReferenceId()));
    return equalsBuilder.isEquals();
}
 
Example 7
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 8
Source Project: googleads-java-lib   Source File: DateTimesTest.java    License: Apache License 2.0 6 votes vote down vote up
/** Asserts that two API date times are equal. */
private static void assertEquals(
    com.google.api.ads.admanager.jaxws.v201911.DateTime expected,
    com.google.api.ads.admanager.jaxws.v201911.DateTime actual) {
  boolean equals =
      expected == actual
          || new EqualsBuilder()
              .append(expected.getDate().getYear(), actual.getDate().getYear())
              .append(expected.getDate().getMonth(), actual.getDate().getMonth())
              .append(expected.getDate().getDay(), actual.getDate().getDay())
              .append(expected.getHour(), actual.getHour())
              .append(expected.getMinute(), actual.getMinute())
              .append(expected.getSecond(), actual.getSecond())
              .append(
                  DateTimeZone.forTimeZone(TimeZone.getTimeZone(expected.getTimeZoneId()))
                      .toTimeZone()
                      .getRawOffset(),
                  DateTimeZone.forTimeZone(TimeZone.getTimeZone(actual.getTimeZoneId()))
                      .toTimeZone()
                      .getRawOffset())
              .isEquals();
  Assert.assertTrue(
      String.format("Expected: <%s> Actual: <%s>", toString(expected), toString(actual)), equals);
}
 
Example 9
Source Project: CodeDefenders   Source File: Mutant.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (this == o) return true;

    if (o == null || getClass() != o.getClass()) return false;

    Mutant mutant = (Mutant) o;

    return new EqualsBuilder()
            .append(id, mutant.id)
            .append(gameId, mutant.gameId)
            .append(playerId, mutant.playerId)
            .append(javaFile, mutant.javaFile)
            .append(md5, mutant.md5)
            .append(classFile, mutant.classFile)
            .isEquals();
}
 
Example 10
Source Project: cloudstack   Source File: SecurityRule.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public boolean equals(final Object obj) {
    if (obj == null) {
        return false;
    }
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof SecurityRule)) {
        return false;
    }
    final SecurityRule another = (SecurityRule) obj;
    return new EqualsBuilder()
            .append(ethertype, another.ethertype)
            .append(ipPrefix, another.ipPrefix)
            .append(portRangeMin, another.portRangeMin)
            .append(portRangeMax, another.portRangeMax)
            .append(profileUuid, another.profileUuid)
            .append(protocol, another.protocol)
            .isEquals();
}
 
Example 11
Source Project: parceler   Source File: CircularReferenceTest.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof Ten)) return false;

    Ten ten = (Ten) o;

    return EqualsBuilder.reflectionEquals(this, ten, new String[]{"nine"});
}
 
Example 12
Source Project: cougar   Source File: RandomException.java    License: Apache License 2.0 5 votes vote down vote up
public boolean equals(Object o) {
    boolean equal = false;

    if (o instanceof RandomException) {
        return new EqualsBuilder().append(getMessage(), ((RandomException)o).getMessage()).isEquals();
    }
    return equal;

}
 
Example 13
Source Project: maven-replacer-plugin   Source File: ReplacerMojoTest.java    License: 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 14
Source Project: spacewalk   Source File: ScriptResult.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public boolean equals(Object obj) {
    if (obj == null || !(obj instanceof ScriptResult)) {
        return false;
    }

    ScriptResult r = (ScriptResult) obj;

    return new EqualsBuilder().append(this.getActionScriptId(), r.getActionScriptId())
                              .append(this.getServerId(), r.getServerId())
                              .append(this.getStartDate(), r.getStartDate())
                              .append(this.getStopDate(), r.getStopDate())
                              .append(this.getReturnCode(), r.getReturnCode())
                              .isEquals();
}
 
Example 15
public boolean equals( Object obj ) {
  if ( obj instanceof FieldTypeSettings == false ) {
    return false;
  }
  if ( this == obj ) {
    return true;
  }
  FieldTypeSettings rhs = (FieldTypeSettings) obj;
  return new EqualsBuilder().append( type, rhs.type ).isEquals();
}
 
Example 16
/**
 * Override needed for PURAP GL entry creation (hjs) - please do not add "amount" to this method
 *
 * @see java.lang.Object#equals(java.lang.Object)
 */
@Override
public boolean equals(Object obj) {
    if (obj == null || !(obj instanceof AccountingLine)) {
        return false;
    }
    AccountingLine accountingLine = (AccountingLine) obj;
    return new EqualsBuilder().append(this.getChartOfAccountsCode(), accountingLine.getChartOfAccountsCode()).append(this.getAccountNumber(), accountingLine.getAccountNumber()).append(this.getSubAccountNumber(), accountingLine.getSubAccountNumber()).append(this.getFinancialObjectCode(), accountingLine.getFinancialObjectCode()).append(this.getFinancialSubObjectCode(), accountingLine.getFinancialSubObjectCode()).append(this.getProjectCode(), accountingLine.getProjectCode()).append(this.getOrganizationReferenceId(), accountingLine.getOrganizationReferenceId()).append(this.getAmount(), accountingLine.getAmount()).isEquals();
}
 
Example 17
Source Project: lams   Source File: CrNodeVersion.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** Two CrNodeVersions are equal if their NvId field is the same */
   @Override
   public boolean equals(Object other) {
if ((this == other)) {
    return true;
}
if (!(other instanceof CrNodeVersion)) {
    return false;
}
CrNodeVersion castOther = (CrNodeVersion) other;
return new EqualsBuilder().append(this.getNvId(), castOther.getNvId()).isEquals();
   }
 
Example 18
Source Project: rice   Source File: ActionListAction.java    License: 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 19
Source Project: daf-kylo   Source File: Operational.java    License: GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public boolean equals(Object other) {
    if (other == this) {
        return true;
    }
    if ((other instanceof Operational) == false) {
        return false;
    }
    Operational rhs = ((Operational) other);
    return new EqualsBuilder().append(isStd, rhs.isStd).append(subtheme, rhs.subtheme).append(groupOwn, rhs.groupOwn).append(logicalUri, rhs.logicalUri).append(storageInfo, rhs.storageInfo).append(ingestionPipeline, rhs.ingestionPipeline).append(inputSrc, rhs.inputSrc).append(readType, rhs.readType).append(theme, rhs.theme).append(additionalProperties, rhs.additionalProperties).append(datasetType, rhs.datasetType).append(physicalUri, rhs.physicalUri).isEquals();
}
 
Example 20
Source Project: dddsample-core   Source File: RouteSpecification.java    License: MIT License 5 votes vote down vote up
@Override
public boolean sameValueAs(final RouteSpecification other) {
  return other != null && new EqualsBuilder().
    append(this.origin, other.origin).
    append(this.destination, other.destination).
    append(this.arrivalDeadline, other.arrivalDeadline).
    isEquals();
}
 
Example 21
public boolean equals( Object obj ) {
  if ( obj instanceof ConceptPropertyNumber == false ) {
    return false;
  }
  if ( this == obj ) {
    return true;
  }
  ConceptPropertyNumber rhs = (ConceptPropertyNumber) obj;
  return new EqualsBuilder().append( value, rhs.value ).isEquals();
}
 
Example 22
Source Project: reef   Source File: DistributedDataSetPartition.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(final Object obj) {
  if (obj == this) {
    return true;
  }
  if (!(obj instanceof DistributedDataSetPartition)) {
    return false;
  }
  final DistributedDataSetPartition that = (DistributedDataSetPartition) obj;
  return new EqualsBuilder().append(this.path, that.path).append(this.location, that.location)
      .append(this.desiredSplits, that.desiredSplits).isEquals();
}
 
Example 23
Source Project: spacewalk   Source File: ActionType.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public boolean equals(Object o) {
    if (o == null || !(o instanceof ActionType)) {
        return false;
    }
    ActionType other = (ActionType)o;
    return new EqualsBuilder().append(this.getId(), other.getId())
                              .append(this.getName(), other.getName())
                              .append(this.getLabel(), other.getLabel())
                              .append(this.getTriggersnapshot(),
                                      other.getTriggersnapshot())
                              .append(this.getUnlockedonly(), other.getUnlockedonly())
                              .isEquals();
}
 
Example 24
Source Project: apiman-plugins   Source File: HeaderAllowDenyBean.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object other) {
    if (other == this) {
        return true;
    }
    if (!(other instanceof HeaderAllowDenyBean)) {
        return false;
    }
    final HeaderAllowDenyBean rhs = ((HeaderAllowDenyBean) other);
    return new EqualsBuilder()
            .append(entries, rhs.entries)
            .isEquals();
}
 
Example 25
@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(documentSecurityAttributeNames, key.documentSecurityAttributeNames);
    return builder.isEquals();
}
 
Example 26
@Override
public boolean equals(Object other) {
    if (other == this) {
        return true;
    }
    if ((other instanceof ExonToTranscriptRelationship) == false) {
        return false;
    }
    ExonToTranscriptRelationship rhs = ((ExonToTranscriptRelationship) other);
    return new EqualsBuilder().append(subject, rhs.subject).append(object, rhs.object).isEquals();
}
 
Example 27
Source Project: parceler   Source File: CircularReferenceTest.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof Five)) return false;
    Five five = (Five) o;
    return EqualsBuilder.reflectionEquals(this, five, new String[]{"a", "b", "c"});
}
 
Example 28
@Override
public boolean equals(Object other) {
    if (other == this) {
        return true;
    }
    if ((other instanceof OrganismTaxon) == false) {
        return false;
    }
    OrganismTaxon rhs = ((OrganismTaxon) other);
    return new EqualsBuilder().isEquals();
}
 
Example 29
@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    MergeRequestChangedLabels that = (MergeRequestChangedLabels) o;
    return new EqualsBuilder()
        .append(previous, that.previous)
        .append(current, that.current)
        .isEquals();
}
 
Example 30
@Override
public boolean equals(Object other) {
    if (other == this) {
        return true;
    }
    if ((other instanceof NoncodingRNAProduct) == false) {
        return false;
    }
    NoncodingRNAProduct rhs = ((NoncodingRNAProduct) other);
    return new EqualsBuilder().isEquals();
}