Package org.apache.commons.lang.builder

Examples of org.apache.commons.lang.builder.CompareToBuilder


    }

    @Override
    public int compareTo(Rule r)
    {
        return new CompareToBuilder()
                .append(getAction(), r.getAction())
                .append(getIdentity(), r.getIdentity())
                .append(getPermission(), r.getPermission())
                .toComparison();
    }
View Full Code Here


                .append(causes)
                .toHashCode();
    }

    public int compareTo(ConstraintOccurrence other) {
        return new CompareToBuilder()
                .append(ruleId, other.ruleId)
                .append(constraintType, other.constraintType)
                .append(causes, other.causes)
                .toComparison();
    }
View Full Code Here

    // ************************************************************************
    // Worker methods
    // ************************************************************************

    public int compare(MoveScope a, MoveScope b) {
        CompareToBuilder compareToBuilder = new CompareToBuilder();
        compareToBuilder.append(a.getScore(), b.getScore(), deciderScoreComparator);
        compareToBuilder.append(a.getAcceptChance(), b.getAcceptChance());
        // moves are not compared
        return compareToBuilder.toComparison();
    }
View Full Code Here

    public int compare(SolverBenchmark a, SolverBenchmark b) {
        List<Score> aScoreList = a.getScoreList();
        Collections.sort(aScoreList); // Worst scores become first in the list
        List<Score> bScoreList = b.getScoreList();
        Collections.sort(bScoreList); // Worst scores become first in the list
        return new CompareToBuilder()
                .append(aScoreList.toArray(), bScoreList.toArray())
                .toComparison();
    }
View Full Code Here

    private WorstScoreSolverBenchmarkComparator worstScoreSolverBenchmarkComparator
            = new WorstScoreSolverBenchmarkComparator();

    public int compare(SolverBenchmark a, SolverBenchmark b) {
        return new CompareToBuilder()
                .append(a.getTotalScore(), b.getTotalScore())
                .append(a, b, worstScoreSolverBenchmarkComparator)
                .toComparison();
    }
View Full Code Here

public class OptionToRemove extends OptionSpecification implements
    Comparable<OptionSpecification> {
  @Override
  public int compareTo(OptionSpecification o) {
    return new CompareToBuilder().append(this.getNamespace(), o.getNamespace())
        .append(this.getOptionName(), o.getOptionName()).toComparison();
  }
View Full Code Here

    Collections.sort(appVersionList,
        new Comparator<ApplicationVersionDescription>() {
          @Override
          public int compare(ApplicationVersionDescription o1,
              ApplicationVersionDescription o2) {
            return new CompareToBuilder().append(o1.getDateUpdated(),
                o2.getDateUpdated()).toComparison();
          }
        });

    if (bDaysToKeepDefined) {
View Full Code Here

    private WorstScoreSolverBenchmarkComparator worstScoreSolverBenchmarkComparator
            = new WorstScoreSolverBenchmarkComparator();

    public int compare(SolverBenchmark a, SolverBenchmark b) {
        return new CompareToBuilder()
                .append(a.getTotalScore(), b.getTotalScore())
                .append(a, b, worstScoreSolverBenchmarkComparator)
                .toComparison();
    }
View Full Code Here

 
  private static final long serialVersionUID = 1L;
 
 
  public int compare(final T o1, final T o2) {
    return new CompareToBuilder().append(o1.getId(), o2.getId()).toComparison();
  }
View Full Code Here

   
    /* (non-Javadoc)
     * @see java.lang.Comparable#compareTo(java.lang.Object)
     */
    public int compareTo(final Message other) {
        return new CompareToBuilder().append(createDate, other.createDate).toComparison();
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.lang.builder.CompareToBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.