Interface EntityImportMapping<K>


public interface EntityImportMapping<K>
Provides the ability to map generated export IDs to locally created IDs during an import and vice versa.
Since:
5.13
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(String exportId, K localId)
    Adds a mapping between the exportId and localId.
    void
    Remove all entries from this mapping
    getExportId(K localId)
    Given a localId, return its corresponding exportId.
    getLocalId(String exportId)
    Given an exportId, return its corresponding localId.
  • Method Details

    • add

      void add(@Nonnull String exportId, @Nonnull K localId)
      Adds a mapping between the exportId and localId.
      Parameters:
      exportId - The ID that was generated during the export
      localId - The local ID for the entity on this instance
      Throws:
      IllegalArgumentException - if either the exportId or the localId have already been mapped previously, either to the same value or a different value
    • clear

      void clear()
      Remove all entries from this mapping
    • getExportId

      @Nonnull Optional<String> getExportId(@Nonnull K localId)
      Given a localId, return its corresponding exportId.
      Parameters:
      localId - The local ID for the entity on this instance
      Returns:
      The export ID that was generated during the import, or Optional.empty().
    • getLocalId

      @Nonnull Optional<K> getLocalId(@Nonnull String exportId)
      Given an exportId, return its corresponding localId.
      Parameters:
      exportId - The export ID that was generated during the import
      Returns:
      The local ID for the entity on this instance, or Optional.empty().