Class ValueNodeComparator

java.lang.Object
com.northconcepts.datapipeline.core.ValueNodeComparator
All Implemented Interfaces:
Cloneable, Comparator<ValueNode<?>>

public class ValueNodeComparator extends Object implements Comparator<ValueNode<?>>, Cloneable
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 Details

    • DEFAULT

      public static final ValueNodeComparator DEFAULT
      A default instance of ValueNodeComparator that can be reused.
  • Constructor Details

    • ValueNodeComparator

      public ValueNodeComparator()
      Creates a new ValueNodeComparator.
  • Method Details

    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • compare

      public int compare(ValueNode valueNode1, ValueNode valueNode2)
      Compares two ValueNode instances for ordering. Null values are sorted before non-null values.
      Specified by:
      compare in interface Comparator<ValueNode<?>>
      Parameters:
      valueNode1 - the first ValueNode to compare
      valueNode2 - 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