List of usage examples for org.apache.commons.lang.builder CompareToBuilder CompareToBuilder
public CompareToBuilder()
Constructor for CompareToBuilder.
Starts off assuming that the objects are equal.
From source file:net.sf.sze.model.stammdaten.Schueler.java
@Override public int compareTo(final Schueler other) { final CompareToBuilder compareBuilder = new CompareToBuilder(); compareBuilder.append(this.getKlasse(), other.getKlasse()); compareBuilder.append(this.getName(), other.getName()); compareBuilder.append(this.getVorname(), other.getVorname()); compareBuilder.append(this.getGeburtstag(), other.getGeburtstag()); compareBuilder.append(this.getGeburtsort(), other.getGeburtsort()); compareBuilder.append(this.getNummer(), other.getNummer()); compareBuilder.append(this.getAufnahmeDatum(), other.getAufnahmeDatum()); compareBuilder.append(this.getAbgangsDatum(), other.getAbgangsDatum()); return compareBuilder.toComparison(); }
From source file:de.pro.dbw.file.reflection.api.ReflectionCommentModel.java
@Override public int compareTo(ReflectionCommentModel other) { return new CompareToBuilder().append(other.getGenerationTime(), this.getGenerationTime()) .append(other.getId(), this.getId()).toComparison(); }
From source file:edu.utah.further.fqe.ds.api.to.plan.DependencyRuleToImpl.java
/** * Result of comparing two edges. Edges are ordered by edge head ID, then by edge tail * ID.// w w w.j ava 2 s. c om * * @param that * the other {@link DependencyRule} object * @return the result of comparison */ @Override public final int compareTo(final DependencyRule that) { return new CompareToBuilder().append(this.getDependencyExecutionId(), that.getDependencyExecutionId()) .append(this.getOutcomeExecutionId(), that.getOutcomeExecutionId()).toComparison(); }
From source file:com.twitter.hraven.Flow.java
/** * Compares two Flow objects on the basis of their FlowKeys * * @param otherFlow//from www .j a va 2 s .c o m * @return 0 if the FlowKeys are equal, * 1 if this FlowKey greater than other FlowKey, * -1 if this FlowKey is less than other FlowKey * */ @Override public int compareTo(Flow otherFlow) { if (otherFlow == null) { return -1; } return new CompareToBuilder().append(this.key, otherFlow.getFlowKey()).toComparison(); }
From source file:gov.nih.nci.caarray.domain.vocabulary.Term.java
/** * {@inheritDoc}//from w w w.j a va 2 s . com */ public int compareTo(Term o) { if (o == null) { throw new NullPointerException(); // NOPMD } return new CompareToBuilder().append(this.getValue(), o.getValue()).append(this.getSource(), o.getSource()) .toComparison(); }
From source file:com.algoTrader.vo.ib.UpdateNewsBulletin.java
/** * @param object to compare this object against * @return int if equal//from w w w . ja v a2 s . co m * @see Comparable#compareTo(Object) */ public int compareTo(final UpdateNewsBulletin object) { if (object == null) { return -1; } // Check if the same object instance if (object == this) { return 0; } return new CompareToBuilder().append(this.getMsgId(), object.getMsgId()) .append(this.getMsgType(), object.getMsgType()).append(this.getMessage(), object.getMessage()) .append(this.getOrigExchange(), object.getOrigExchange()).toComparison(); }
From source file:net.sf.sze.model.zeugnis.Bewertung.java
@Override public int compareTo(final Bewertung other) { final CompareToBuilder compareBuilder = new CompareToBuilder(); compareBuilder.append(this.schulfach, other.schulfach); compareBuilder.append(this.zeugnis, other.zeugnis); compareBuilder.append(this.note, other.note); compareBuilder.append(this.leistungsniveau, other.leistungsniveau); compareBuilder.append(this.sonderNote, other.sonderNote); compareBuilder.append(this.relevant, other.relevant); compareBuilder.append(this.leistungNurSchwachAusreichend, other.leistungNurSchwachAusreichend); return compareBuilder.toComparison(); }
From source file:edu.utah.further.fqe.ds.api.to.plan.ExecutionRuleToImpl.java
/** * Result of comparing two keys. keys are ordered by search query ID, then by DS ID. * * @param that//from w w w . j av a2s. c o m * the other {@link ExecutionRule} object * @return the result of comparison */ @Override public final int compareTo(final ExecutionRule that) { return new CompareToBuilder().append(this.getSearchQueryId(), that.getSearchQueryId()) .append(this.getDataSourceId(), that.getDataSourceId()).toComparison(); }
From source file:com.hmsinc.epicenter.webapp.remoting.AnalysisService.java
/** * @param paramsDTO/* ww w.j a v a 2 s .c om*/ * @return */ @Secured("ROLE_USER") @Transactional(readOnly = true) @RemoteMethod @SuppressWarnings("unchecked") public String getSummaryChart(final AnalysisParametersDTO paramsDTO) { final AnalysisParameters analysisParameters = convertParameters(paramsDTO); final Class<? extends Geography> aggregateType = (Class<? extends Geography>) ModelUtils .getRealClass(analysisParameters.getContainer()); final TimeSeriesCollection<? extends Geography, Classification> tsc = dataQueryService .query(analysisParameters, aggregateType); final TimeSeriesChart chart = new TimeSeriesChart(); chart.setType(ChartType.MOUNTAIN); chart.setYLabel("Number of Visits"); if (tsc.getPrimaryIndexes().contains(analysisParameters.getContainer())) { final Map<Classification, TimeSeries> tsm = tsc.getMaps().get(analysisParameters.getContainer()); // Sort the map by the max value in the timeseries. final ArrayList<Classification> keys = new ArrayList<Classification>(); keys.addAll(tsm.keySet()); Collections.sort(keys, new Comparator<Classification>() { public int compare(Classification o1, Classification o2) { return new CompareToBuilder().append(tsm.get(o2).getMaxValue(), tsm.get(o1).getMaxValue()) .toComparison(); } }); int i = 0; for (Classification c : keys) { if (!"Other".equals(c.getName())) { chart.add(c.getName(), tsm.get(c)); i++; if (i > 6) { break; } } } } return chartService.getChartURL(chart); }
From source file:gov.nih.nci.firebird.service.task.Task.java
@Override public int compareTo(Task task) { return new CompareToBuilder().append(getDateAdded(), task.getDateAdded()) .append(getDescription(), task.getDescription()).toComparison(); }