Class MatchDefinitionComparator

java.lang.Object
com.aquima.interactions.matching.impl.model.MatchDefinitionComparator
All Implemented Interfaces:
Comparator<IMatchDefinition>

public class MatchDefinitionComparator extends Object implements Comparator<IMatchDefinition>
Sorts MatchDefinitions to ensure that master attributes are always matched before their child. Sorting a list of MatchDefinitions requires two steps:
  • Sort the list using the compareTo method of the MatchDefinition class. This will produce a list in which the match definitions are sorted on weight and threshold.
  • Sort the list using this MatchDefinitionComparator to also sort the match definitions on master-slave relations.
Since:
7.1
Author:
m.sloof
  • Constructor Details

    • MatchDefinitionComparator

      protected MatchDefinitionComparator(List<IMatchDefinition> matchDefinitions)
  • Method Details

    • compare

      public int compare(IMatchDefinition one, IMatchDefinition two)
      Compares two IMatchDefinition objects. The comparison uses the list of attributenames that is sorted on master-slave relations.
      Specified by:
      compare in interface Comparator<IMatchDefinition>
      Parameters:
      one - First element used in compare
      two - Second element used in compare
      Returns:
      Compare result