Class CmpResult<B,​W>


  • public class CmpResult<B,​W>
    extends Object
    • Method Detail

      • getAll

        public List<CmpPair<B,​W>> getAll()
        Gets all compare pairs, changed and unchanged
        Returns:
        list of compare pairs
      • getRemoved

        public List<CmpPair<B,​W>> getRemoved()
        Gets all compare pairs of items removed from base collection
        Returns:
        list of compare pairs
      • getAdded

        public List<CmpPair<B,​W>> getAdded()
        Gets all compare pairs of items added to working collection
        Returns:
        list of compare pairs
      • getUpdated

        public List<CmpPair<B,​W>> getUpdated()
        Gets all compare pairs of items that exist in both collections but were updated. Updated means changed based on equals function.
        Returns:
        list of compare pairs
      • getUnchanged

        public List<CmpPair<B,​W>> getUnchanged()
        Gets all compare pairs of unchanged items
        Returns:
        list of compare pairs
      • getChanged

        public List<CmpPair<B,​W>> getChanged()
        Gets all compare pairs of changed items
        Returns:
        list of compare pairs
      • getDifferent

        public List<CmpPair<B,​W>> getDifferent()
        Gets all compare pairs different items - items removed from base collection or added to working collection
        Returns:
        list of compare pairs
      • getAddedItems

        public List<W> getAddedItems()
        Gets all items added to working collection
        Returns:
        list of added items
      • getRemovedItems

        public List<B> getRemovedItems()
        Gets all items removed from base collection
        Returns:
        list of removed items
      • getDifferentItems

        public List<Object> getDifferentItems()
        Gets all items removed from base collection or added to working collection
        Returns:
        list different items
      • getChangesCount

        public int getChangesCount()
        Gets number of changes. Sum of removed, added, updated items.
        Returns:
        changes count
      • hasChanges

        public boolean hasChanges()
        Returns:
        true if changes exist
      • getDifferentCount

        public int getDifferentCount()
        Gets number of different items = items removed from base collection or added to working collection.
        Returns:
        number of different items
        See Also:
        getDifferent()
      • hasDifferences

        public boolean hasDifferences()
        Returns:
        true if differences exist
        See Also:
        getDifferent()
      • forEach

        public void forEach​(Consumer<CmpPair<B,​W>> action)
        Performs action on each compare pair
        Parameters:
        action - action to perform
      • forEachChanged

        public void forEachChanged​(Consumer<CmpPair<B,​W>> action)
        Performs action on each changed compare pair
        Parameters:
        action - action to perform
      • forEachUnchanged

        public void forEachUnchanged​(Consumer<CmpPair<B,​W>> action)
        Performs action on each unchanged compare pair
        Parameters:
        action - action to perform
      • stream

        public Stream<CmpPair<B,​W>> stream()
        Streams all compare pairs
        Returns:
        stream
      • streamChanged

        public Stream<CmpPair<B,​W>> streamChanged()
        Streams all changed compare pairs
        Returns:
        stream
      • streamUnchanged

        public Stream<CmpPair<B,​W>> streamUnchanged()
        Streams all unchanged compare pairs
        Returns:
        stream
      • streamDifferent

        public Stream<CmpPair<B,​W>> streamDifferent()
        Streams all different compare pairs
        Returns:
        stream
        See Also:
        getDifferent()