Class InstanceComparator
java.lang.Object
com.aquima.interactions.profile.model.InstanceComparator
- All Implemented Interfaces:
Comparator<IEntityInstance>
This class is used to sort the instances from a context expression.
- Since:
- 6.0
- Author:
- O. Kerpershoek
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a default instance comparator that sorts the instances ascending on sequence number.InstanceComparator
(String sortAttribute, boolean sortAscending) Constructs the instance comparator with the name of the attribute the instances should be sorted on. -
Method Summary
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
-
InstanceComparator
public InstanceComparator()Constructs a default instance comparator that sorts the instances ascending on sequence number. The oldest instance (lowest sequence number) will be first. -
InstanceComparator
Constructs the instance comparator with the name of the attribute the instances should be sorted on.- Parameters:
sortAttribute
- The name of the attribute that should be used to sort the instances on.sortAscending
- Boolean indicating if the instances should be sorted ascending (true) or descending (false).
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<IEntityInstance>
-