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.intuit.tank.project.ScriptGroup.java

@Override
public int compareTo(ScriptGroup o) {
    if (o == null) {
        return 1;
    }/*from w  w  w.  j a v  a  2s.  c  o m*/
    return new CompareToBuilder().append(position, o.position).toComparison();
}

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

/**
 * @param object to compare this object against
 * @return int if equal//from  w w  w.  ja  v a 2  s  . c  o  m
 * @see Comparable#compareTo(Object)
 */
public int compareTo(final TickSize object) {
    if (object == null) {
        return -1;
    }
    // Check if the same object instance
    if (object == this) {
        return 0;
    }
    return new CompareToBuilder().append(this.getTickerId(), object.getTickerId())
            .append(this.getField(), object.getField()).append(this.getSize(), object.getSize()).toComparison();
}

From source file:com.vmware.appfactory.application.model.AppBuildRequest.java

/**
 * The comparison order is most recent first.
 */// ww  w . ja v  a2s.c  om
@Override
public int compareTo(AppBuildRequest o) {
    return new CompareToBuilder().append(o.getCreated(), this.getCreated()).toComparison();
}

From source file:com.opengamma.util.tuple.Pair.java

/**
 * Compares the pair based on the first element followed by the second element.
 * The types must be {@code Comparable}.
 * //from w w  w  .  j a  v a2s.  c  om
 * @param other  the other pair, not null
 * @return negative if this is less, zero if equal, positive if greater
 */
@Override
public int compareTo(Pair<A, B> other) {
    return new CompareToBuilder().append(getFirst(), other.getFirst()).append(getSecond(), other.getSecond())
            .toComparison();
}

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

public int compareTo(LoginPlugin loginPlugin) {
    if (loginPlugin == null) {
        return 1;
    }/* w w  w . jav  a2 s  .  c  om*/
    return new CompareToBuilder().append(getOrder(), loginPlugin.getOrder())
            .append(getId(), loginPlugin.getId()).toComparison();
}

From source file:com.hmsinc.epicenter.webapp.dto.CasesDTO.java

public int compareTo(final CasesDTO g) {
    return new CompareToBuilder().append(interactionDate, g.getInteractionDate())
            .append(facilityName, g.getFacilityName()).toComparison();
}

From source file:com.iggroup.oss.restdoclet.doclet.type.BaseType.java

/**
 * {@inheritDoc}// w w  w  .  j  ava 2s.c o  m
 */
@Override
public int compareTo(final BaseType param) {
    int result;
    if (param == null) {
        result = 1;
    } else {
        result = new CompareToBuilder().append(name, param.name).append(type, param.type).toComparison();
    }
    return result;
}

From source file:gov.nih.nci.caarray.domain.file.FileType.java

/**
 * {@inheritDoc}/* w ww.  ja v  a2  s. c  om*/
 */
@Override
public int compareTo(FileType ft) {
    return new CompareToBuilder().append(this.name, ft.name).toComparison();
}

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

/**
 * @param object to compare this object against
 * @return int if equal/*from  w w w  .j  a  v a 2s. c o m*/
 * @see Comparable#compareTo(Object)
 */
public int compareTo(final TickGeneric object) {
    if (object == null) {
        return -1;
    }
    // Check if the same object instance
    if (object == this) {
        return 0;
    }
    return new CompareToBuilder().append(this.getTickerId(), object.getTickerId())
            .append(this.getTickType(), object.getTickType()).append(this.getValue(), object.getValue())
            .toComparison();
}

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

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