List of usage examples for org.apache.commons.lang.builder CompareToBuilder append
public CompareToBuilder append(Object[] lhs, Object[] rhs, Comparator comparator)
Appends to the builder
the deep comparison of two Object
arrays.
==
null
, null
is less than non-null
This method will also will be called for the top level of multi-dimensional, ragged, and multi-typed arrays.
From source file:org.drools.planner.core.localsearch.decider.forager.AcceptedMoveScopeComparator.java
public int compare(MoveScope a, MoveScope b) { CompareToBuilder compareToBuilder = new CompareToBuilder(); compareToBuilder.append(a.getScore(), b.getScore(), deciderScoreComparator); // moves are not compared return compareToBuilder.toComparison(); }
From source file:org.kuali.kra.common.notification.lookup.keyvalue.KeyLabelSortByValue.java
@Override public int compareTo(KeyLabelPair o) { if (o == null) { throw new NullPointerException("the object to compare to is null"); }//from w ww . ja va 2 s.co m CompareToBuilder builder = new CompareToBuilder(); builder.append(this.label, o.label, String.CASE_INSENSITIVE_ORDER); if ((this.key instanceof String) && (o.key instanceof String)) builder.append(this.key, o.key, String.CASE_INSENSITIVE_ORDER); else { builder.append(this.key, o.key); } builder.append(this.numPaddedSpaces, o.numPaddedSpaces); return builder.toComparison(); }