public interface

EntityImportMapping

com.atlassian.bitbucket.migration.EntityImportMapping<K>

Class Overview

Provides the ability to map generated export IDs to locally created IDs during an import and vice versa.

Summary

Public Methods
void add(String exportId, K localId)
Adds a mapping between the exportId and localId.
void clear()
Remove all entries from this mapping
@Nonnull Optional<String> getExportId(K localId)
Given a localId, return its corresponding exportId.
@Nonnull Optional<K> getLocalId(String exportId)
Given an exportId, return its corresponding localId.

Public Methods

public void add (String exportId, 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

public void clear ()

Remove all entries from this mapping

@Nonnull public Optional<String> getExportId (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 empty().

@Nonnull public Optional<K> getLocalId (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 empty().