Class ReferenceChangeTracker


  • public class ReferenceChangeTracker
    extends java.lang.Object
    Helper class used to keep track of uuid mappings (e.g. if the uuid of an imported or copied node is mapped to a new uuid) and processed (e.g. imported or copied) reference properties that might need to be adjusted depending on the UUID mapping resulting from the import.
    See Also:
    ImportUUIDBehavior
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Resets all internal state.
      @Nullable java.lang.String get​(@NotNull java.lang.String oldUUID)
      Returns the new node id to which oldUUID has been mapped or null if no such mapping exists.
      @NotNull java.util.Iterator<java.lang.Object> getProcessedReferences()
      Returns an iterator over all processed reference properties.
      void processedReference​(@NotNull java.lang.Object refProp)
      Store the given reference property for later retrieval using getProcessedReferences().
      void put​(@NotNull java.lang.String oldUUID, @NotNull java.lang.String newUUID)
      Store the given id mapping for later lookup using get(String).
      boolean removeReferences​(java.util.List<java.lang.Object> processedReferences)
      Remove the given references that have already been processed from the references list.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReferenceChangeTracker

        public ReferenceChangeTracker()
    • Method Detail

      • get

        @Nullable
        public @Nullable java.lang.String get​(@NotNull
                                              @NotNull java.lang.String oldUUID)
        Returns the new node id to which oldUUID has been mapped or null if no such mapping exists.
        Parameters:
        oldUUID - old node id
        Returns:
        mapped new id or null if no such mapping exists
        See Also:
        put(String, String)
      • put

        public void put​(@NotNull
                        @NotNull java.lang.String oldUUID,
                        @NotNull
                        @NotNull java.lang.String newUUID)
        Store the given id mapping for later lookup using get(String).
        Parameters:
        oldUUID - old node id
        newUUID - new node id
      • clear

        public void clear()
        Resets all internal state.
      • processedReference

        public void processedReference​(@NotNull
                                       @NotNull java.lang.Object refProp)
        Store the given reference property for later retrieval using getProcessedReferences().
        Parameters:
        refProp - reference property
      • getProcessedReferences

        @NotNull
        public @NotNull java.util.Iterator<java.lang.Object> getProcessedReferences()
        Returns an iterator over all processed reference properties.
        Returns:
        an iterator over all processed reference properties
        See Also:
        processedReference(Object)
      • removeReferences

        public boolean removeReferences​(java.util.List<java.lang.Object> processedReferences)
        Remove the given references that have already been processed from the references list.
        Parameters:
        processedReferences - List of processed references to be removed.
        Returns:
        true if the internal list of references changed.