Class MatchDefinitionComparator
java.lang.Object
com.aquima.interactions.matching.impl.model.MatchDefinitionComparator
- All Implemented Interfaces:
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 Summary
ConstructorsModifierConstructorDescriptionprotected
MatchDefinitionComparator
(List<IMatchDefinition> matchDefinitions) -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(IMatchDefinition one, IMatchDefinition two) Compares two IMatchDefinition objects.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
Method Details
-
compare
Compares two IMatchDefinition objects. The comparison uses the list of attributenames that is sorted on master-slave relations.- Specified by:
compare
in interfaceComparator<IMatchDefinition>
- Parameters:
one
- First element used in comparetwo
- Second element used in compare- Returns:
- Compare result
-