Class ParameterComparator
java.lang.Object
de.aristaflow.adept2.model.common.tools.ParameterComparator
- All Implemented Interfaces:
SerialisableComparator<Parameter>,Serializable,Comparator<Parameter>
This comparator can be used to compare (process) parameters.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringThe key for the parameter configuration providing the position of the parameter (if set).protected final SerialisableComparator<UUID>The comparator comparing UUIDs unsigned, that is a leading 8 is less than a leading 7. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newParameterComparatorwith a UUID comparator comparing UUIDs unsigned.ParameterComparator(String paramConfKeyPos) Creates a newParameterComparatorwith a UUID comparator comparing UUIDs unsigned an using the designated key to retrieve the position from the parameter configuration. -
Method Summary
Modifier and TypeMethodDescriptionintstatic <T extends Parameter>
Collection<T>getSortedParams(Collection<T> unsortedParams) Creates a new collection having the designated parameters sorted with this comparator.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
paramConfKeyPos
The key for the parameter configuration providing the position of the parameter (if set). If this isnull, the position will be ignored when comparing. -
uuidComparator
The comparator comparing UUIDs unsigned, that is a leading 8 is less than a leading 7.
-
-
Constructor Details
-
ParameterComparator
public ParameterComparator()Creates a newParameterComparatorwith a UUID comparator comparing UUIDs unsigned. -
ParameterComparator
Creates a newParameterComparatorwith a UUID comparator comparing UUIDs unsigned an using the designated key to retrieve the position from the parameter configuration. This may benull.- Parameters:
paramConfKeyPos- The key for the parameter configuration providing the position of the parameter (if set). If this isnull, the position will be ignored when comparing.
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<Parameter>
-
getSortedParams
Creates a new collection having the designated parameters sorted with this comparator.- Parameters:
unsortedParams- The unsorted collection of parameters.- Returns:
- A sorted collection of the parameters.
-