Class ValueNodeComparator
java.lang.Object
com.northconcepts.datapipeline.core.ValueNodeComparator
- All Implemented Interfaces:
Cloneable,Comparator<ValueNode<?>>
A comparator for
ValueNode instances that supports sorting and comparing records, arrays, and single values.
This comparator delegates to the natural comparison logic defined in ValueNode's compareTo method.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ValueNodeComparatorA default instance of ValueNodeComparator that can be reused. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
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
-
DEFAULT
A default instance of ValueNodeComparator that can be reused.
-
-
Constructor Details
-
ValueNodeComparator
public ValueNodeComparator()Creates a new ValueNodeComparator.
-
-
Method Details
-
clone
-
compare
Compares two ValueNode instances for ordering. Null values are sorted before non-null values.- Specified by:
comparein interfaceComparator<ValueNode<?>>- Parameters:
valueNode1- the first ValueNode to comparevalueNode2- the second ValueNode to compare- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second
-