Example usage for org.apache.commons.lang.builder CompareToBuilder CompareToBuilder

List of usage examples for org.apache.commons.lang.builder CompareToBuilder CompareToBuilder

Introduction

In this page you can find the example usage for org.apache.commons.lang.builder CompareToBuilder CompareToBuilder.

Prototype

public CompareToBuilder() 

Source Link

Document

Constructor for CompareToBuilder.

Starts off assuming that the objects are equal.

Usage

From source file:com.redhat.rhn.domain.user.StateChange.java

/**
 * {@inheritDoc}//w w  w .  j  av  a2 s.  c  o  m
 */
public int compareTo(StateChange rhs) {
    CompareToBuilder builder = new CompareToBuilder();
    builder.append(getDate(), rhs.getDate());
    builder.append(getId(), rhs.getId());
    builder.append(this.getState(), rhs.getState());
    builder.append(this.getUser(), rhs.getUser());
    builder.append(this.getChangedBy(), rhs.getChangedBy());
    return builder.toComparison();
}

From source file:edu.utah.further.ds.further.model.impl.domain.PersonAssociationId.java

@Override
public int compareTo(final PersonAssociationId other) {
    return new CompareToBuilder().append(other.getId(), this.getId())
            .append(other.getDatasetId(), this.getDatasetId()).toComparison();
}

From source file:edu.utah.further.ds.further.model.impl.domain.OrderId.java

@Override
public int compareTo(final OrderId other) {
    return new CompareToBuilder().append(other.getId(), this.getId())
            .append(other.getDatasetId(), this.getDatasetId()).toComparison();
}

From source file:com.algoTrader.vo.ib.ManagedAccounts.java

/**
 * @param object to compare this object against
 * @return int if equal/*from   www .  j av  a2  s.  c  o m*/
 * @see Comparable#compareTo(Object)
 */
public int compareTo(final ManagedAccounts object) {
    if (object == null) {
        return -1;
    }
    // Check if the same object instance
    if (object == this) {
        return 0;
    }
    return new CompareToBuilder().append(this.getAccountsList(), object.getAccountsList()).toComparison();
}

From source file:edu.utah.further.ds.further.model.impl.domain.StorageId.java

@Override
public int compareTo(final StorageId other) {
    return new CompareToBuilder().append(other.getId(), this.getId())
            .append(other.getDatasetId(), this.getDatasetId()).toComparison();
}

From source file:edu.utah.further.ds.further.model.impl.domain.SpecimenId.java

@Override
public int compareTo(final SpecimenId other) {
    return new CompareToBuilder().append(other.getId(), this.getId())
            .append(other.getDatasetId(), this.getDatasetId()).toComparison();
}

From source file:edu.utah.further.ds.further.model.impl.domain.ConditionEraId.java

@Override
public int compareTo(final ConditionEraId other) {
    return new CompareToBuilder().append(other.getId(), this.getId())
            .append(other.getDatasetId(), this.getDatasetId()).toComparison();
}

From source file:com.twitter.hraven.TaskDetails.java

/**
 * Compares two TaskDetails objects on the basis of their TaskKey
 *
 * @param other//  w w w. ja  v a 2 s. com
 * @return 0 if this TaskKey is equal to the other TaskKey,
 *        1 if this TaskKey greater than other TaskKey,
 *       -1 if this TaskKey is less than other TaskKey
 *
 */
@Override
public int compareTo(TaskDetails otherTask) {
    if (otherTask == null) {
        return -1;
    }

    return new CompareToBuilder().append(this.taskKey, otherTask.getTaskKey()).toComparison();
}

From source file:edu.utah.further.ds.further.model.impl.domain.ProviderLocationId.java

@Override
public int compareTo(final ProviderLocationId other) {
    return new CompareToBuilder().append(other.getId(), this.getId())
            .append(other.getDatasetId(), this.getDatasetId()).toComparison();
}

From source file:edu.utah.further.ds.i2b2.model.impl.domain.EncounterMappingPK.java

/**
 * @param o// w  w w.  j  a  v  a2  s .c  om
 * @return
 * @see java.lang.Comparable#compareTo(java.lang.Object)
 */
@Override
public int compareTo(EncounterMappingId that) {
    return new CompareToBuilder().append(this.getEncounterIde(), that.getEncounterIde())
            .append(this.getEncounterIdeSource(), that.getEncounterIdeSource()).toComparison();
}