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.twitter.hraven.JobDetails.java

/**
 * Compares two JobDetails objects on the basis of their JobKey
 *
 * @param other//w ww .j  a  va 2  s.c o m
 * @return 0 if this JobKey is equal to the other JobKey,
 *        1 if this JobKey greater than other JobKey,
 *       -1 if this JobKey is less than other JobKey
 *
 */
@Override
public int compareTo(JobDetails otherJob) {
    if (otherJob == null) {
        return -1;
    }
    return new CompareToBuilder().append(this.jobKey, otherJob.getJobKey()).toComparison();
}

From source file:io.yields.math.framework.kpi.ScoreResult.java

@Override
public int compareTo(ScoreResult other) {
    return new CompareToBuilder().append(other.getScore(), this.score).append(other.getName(), this.name)
            .toComparison();/*from w w  w. j a  v  a 2 s.  co m*/
}

From source file:com.discursive.jccook.lang.builders.PoliticalCandidate.java

public int compareTo(Object o) {
    int compare = -1; // By default return less-than
    if (o != null && PoliticalCandidate.class.isAssignableFrom(o.getClass())) {
        PoliticalCandidate pc = (PoliticalCandidate) o;
        compare = (new CompareToBuilder().append(firstName, pc.firstName).append(lastName, pc.lastName))
                .toComparison();/*w w w.j a va2 s.c  om*/
    }
    return compare;
}

From source file:com.vmware.appfactory.cws.CwsSettingsRegValue.java

@Override
public int compareTo(CwsSettingsRegValue o) {
    return new CompareToBuilder().append(this._data, o._data).append(this._type, o._type).toComparison();
}

From source file:edu.utah.further.mdr.data.common.domain.asset.ResourceTypeEntity.java

/**
 * @param other/*from  ww w  .  j  a  v a 2  s  .  c om*/
 * @return
 * @see edu.utah.further.mdr.api.domain.asset.LookupValue#compareTo(edu.utah.further.mdr.api.domain.asset.LookupValue)
 */
@Override
public int compareTo(final ResourceType other) {
    return new CompareToBuilder().append(this.order, other.getOrder()).append(this.label, other.getLabel())
            .toComparison();
}

From source file:eu.debooy.natuur.domain.FotoOverzichtDto.java

public int compareTo(FotoOverzichtDto fotoOverzichtDto) {
    return new CompareToBuilder().append(fotoId, fotoOverzichtDto.fotoId).toComparison();
}

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

public int compareTo(DataTypeDTO o) {
    return new CompareToBuilder().append(allClassifiersBeta, o.isAllClassifiersBeta()).append(name, o.getName())
            .append(id, o.getId()).toComparison();
}

From source file:com.processpuzzle.internalization.domain.ProcessPuzzleLocale.java

public int compareTo(Object other) {
    Locale javaLocale = getJavaLocale();
    int result = 0;
    if (other instanceof ProcessPuzzleLocale) {
        ProcessPuzzleLocale o = (ProcessPuzzleLocale) other;
        result = new CompareToBuilder().append(javaLocale.getLanguage(), o.getLanguage())
                .append(javaLocale.getCountry(), o.getCountry()).append(javaLocale.getVariant(), o.getVariant())
                .toComparison();/*  w w  w.  ja v  a2  s .c  o m*/
    }
    return result;
}

From source file:com.dp2345.plugin.StoragePlugin.java

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

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

@Override
public int compareTo(Object other) {
    if (other == null) {
        return -1;
    }/*from   w w w. j a v a2  s.  c o  m*/
    HdfsStatsKey otherKey = (HdfsStatsKey) other;
    return new CompareToBuilder().append(this.pathKey, otherKey.getQualifiedPathKey())
            .append(this.encodedRunId, otherKey.getEncodedRunId()).toComparison();
}