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:edu.utah.further.dts.api.domain.concept.DtsPropertyImpl.java

/**
 * Compare two pairs by lexicographic name order.
 *
 * @param other/*from w w  w.  j  a  v  a2 s .c  om*/
 *            the other {@link DtsProperty} to be compared with this one.
 * @return the result of comparison
 */
@Override
public final int compareTo(final DtsProperty other) {
    return new CompareToBuilder().append(this.getName(), other.getName()).toComparison();
}

From source file:edu.utah.further.fqe.api.ws.to.aggregate.CategoryTo.java

/**
 * Result of comparing demographic categories. They are ordered by their names.
 *
 * @param other//from  www .j a va  2s.c o  m
 *            the other {@link CategoryTo} object
 * @return the result of comparison
 */
@Override
public int compareTo(final Category other) {
    return new CompareToBuilder().append(this.getName(), other.getName()).toComparison();
}

From source file:net.rrm.ehour.domain.Project.java

/**
 * @see java.lang.Comparable#compareTo(Object)
 */// www.j  a  v a2s .c o  m
public int compareTo(Project object) {
    return new CompareToBuilder().append(this.getName(), object.getName())
            .append(this.getProjectCode(), object.getProjectCode())
            .append(this.getCustomer(), object.getCustomer()).append(this.getProjectId(), object.getProjectId())
            .toComparison();
}

From source file:net.shopxx.plugin.OAuthPlugin.java

public int compareTo(OAuthPlugin storagePlugin) {
    return new CompareToBuilder().append(getOrder(), storagePlugin.getOrder())
            .append(getId(), storagePlugin.getId()).toComparison();
}

From source file:com.hmsinc.epicenter.model.workflow.Attachment.java

public int compareTo(Attachment rhs) {
    return new CompareToBuilder().append(timestamp, rhs.getTimestamp()).append(id, rhs.getId()).toComparison();
}

From source file:net.sf.sze.model.zeugnisconfig.Schulfach.java

@Override
public int compareTo(final Schulfach other) {
    final CompareToBuilder compareBuilder = new CompareToBuilder();
    compareBuilder.append(this.typ, other.typ);
    compareBuilder.append(this.sortierung, other.sortierung);
    compareBuilder.append(this.name, other.name);
    return compareBuilder.toComparison();
}

From source file:com.xtructure.xutil.ValueMap.java

@SuppressWarnings("unchecked")
@Override//from  ww  w . jav a 2  s .co  m
public int compareTo(ValueMap that) {
    if (that == null) {
        return Integer.MAX_VALUE;
    }
    if (this.keySet().equals(that.keySet())) {
        CompareToBuilder ctb = new CompareToBuilder();
        List<XValId<?>> ids = new ArrayList<XValId<?>>(this.keySet());
        Collections.sort(ids);
        for (@SuppressWarnings("rawtypes")
        XValId id : ids) {
            ctb.append(this.get(id), that.get(id));
        }
        return ctb.toComparison();
    } else {
        List<XValId<?>> thisIds = new ArrayList<XValId<?>>(this.keySet());
        List<XValId<?>> thatIds = new ArrayList<XValId<?>>(that.keySet());
        Collections.sort(thisIds);
        Collections.sort(thatIds);
        return new CompareToBuilder()//
                .append(thisIds.toArray(new XValId<?>[0]), thatIds.toArray(new XValId<?>[0]))//
                .toComparison();
    }
}

From source file:com.hmsinc.epicenter.model.permission.EpiCenterRole.java

public int compareTo(Object o) {
    final EpiCenterRole other = (EpiCenterRole) o;
    return new CompareToBuilder().append(permission, other.getPermission()).append(id, other.getId())
            .toComparison();//ww w. ja v  a  2s .  c o m
}

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

/**
 * @param object to compare this object against
 * @return int if equal/*from   ww  w . java 2 s.co m*/
 * @see Comparable#compareTo(Object)
 */
public int compareTo(final OpenOrder object) {
    if (object == null) {
        return -1;
    }
    // Check if the same object instance
    if (object == this) {
        return 0;
    }
    return new CompareToBuilder().append(this.getOrderId(), object.getOrderId())
            .append(this.getContract(), object.getContract()).append(this.getOrder(), object.getOrder())
            .append(this.getOrderState(), object.getOrderState()).toComparison();
}

From source file:com.xtructure.xneat.genetics.impl.AbstractGene.java

@Override
public int compareTo(XIdObject that) {
    if (that != null && that instanceof Gene) {
        return new CompareToBuilder()//
                .append(this.getInnovation(), ((Gene) that).getInnovation())//
                .toComparison();//from  ww  w  .j a v a  2 s . c  o  m
    }
    return 1;
}