Class ComparedObjects<T>

    • Constructor Detail

      • ComparedObjects

        public ComparedObjects()
        Constructs an empty provider.
      • ComparedObjects

        public ComparedObjects​(T main,
                               T other,
                               T commonAncestor)
        Constructs a triple of objects being compared.
        Parameters:
        main - the main object, may be null
        other - the other object, may be null
        commonAncestor - the common ancestor object, may be null
    • Method Detail

      • getComparedObject

        public T getComparedObject​(ComparisonSide side)
        Description copied from interface: IComparedObjects
        Returns a compared object on the specified side.
        Specified by:
        getComparedObject in interface IComparedObjects<T>
        Parameters:
        side - the side to get the object for, not null
        Returns:
        the object on the side, may be null
      • setComparedObject

        public void setComparedObject​(ComparisonSide side,
                                      T object)
        Sets the compared object for the specified side.
        Specified by:
        setComparedObject in interface IComparedObjects<T>
        Parameters:
        side - the side to set the compared object for
        object - the compared object to set
      • getObjectSide

        public ComparisonSide getObjectSide()
        Description copied from interface: IComparedObjects
        Returns MAIN or OTHER side if the object presents only on the one of them. Fully ignores object's presence on COMMON_ANCESTOR side.
        Specified by:
        getObjectSide in interface IComparedObjects<T>
        Returns:
        the MAIN or OTHER side or null if it presents on both of them or doesn't present on any of them
      • getOrder

        public int getOrder​(ComparisonSide side)
        Description copied from interface: IComparedObjects
        Returns the order index of the source object from the specified side.
        Specified by:
        getOrder in interface IComparedObjects<T>
        Parameters:
        side - the side of the object, not null
        Returns:
        the order index or -1 if no order stored
      • setOrder

        public void setOrder​(ComparisonSide side,
                             int order)
        Description copied from interface: IComparedObjects
        Sets the order index of a source object on the specified side.
        Specified by:
        setOrder in interface IComparedObjects<T>
        Parameters:
        side - the side of the source object, not null
        order - the source object order index
      • getPath

        public ComparedObjectPath getPath​(ComparisonSide side)
        Description copied from interface: IComparedObjects
        Returns path to the compared object.
        Specified by:
        getPath in interface IComparedObjects<T>
        Parameters:
        side - the comparison side to get the path for, not null
        Returns:
        the path to the compared object from the closest top parent, never null