Class AbstractMatchedObjectOrderer<U>

    • Constructor Detail

      • AbstractMatchedObjectOrderer

        protected AbstractMatchedObjectOrderer​(Collection<U> matchedObjects)
        Constructs an orderer.
        Parameters:
        matchedObjects - the matched objects to work with, cannot be null
    • Method Detail

      • getMatchedObjects

        public Collection<U> getMatchedObjects()
        Returns the matched objects this orderer is working with.
        Returns:
        the matched objects
      • getOrdered

        public List<U> getOrdered​(MergeRule mergeRule)
        Returns a list of matched objects ordered according to the specified merge rule.
        Parameters:
        mergeRule - the rule that will be used to determine the resulting order
        Returns:
        the list of matched objects ordered according to the rule
      • getWithChangedOrder

        public List<U> getWithChangedOrder​(ComparisonSide side1,
                                           ComparisonSide side2)
        Returns a list of matched objects whose order was changed between the specified sides.
        Parameters:
        side1 -
        side2 -
        Returns:
      • isPresent

        protected abstract boolean isPresent​(U object,
                                             ComparisonSide side)
        Checks whether a source object is present on the specified side of the matched object.
        Parameters:
        object - the matched object
        side - the source side to check
        Returns:
        true when the source object is present
      • getOrder

        protected abstract int getOrder​(U object,
                                        ComparisonSide side)
        Returns the original order index of the source object on the specified side.
        Parameters:
        object - the matched object
        side - the side of the source object
        Returns:
        order index of the source object (irrelevant if the object is not present)