Class AuthorDuplicateNameHelper


  • public class AuthorDuplicateNameHelper
    extends Object
    Utility class for BAM-5701
    • Constructor Detail

      • AuthorDuplicateNameHelper

        public AuthorDuplicateNameHelper()
    • Method Detail

      • createNameMarkerPattern

        public static String createNameMarkerPattern​(long originalId,
                                                     long duplicateId)
        Create fake author name: "originalAuthorId;duplicateAuthorId". This method relies on a fact that it is unlikely that real author name would be something like "123456;234567"
        Parameters:
        originalId - original author id
        duplicateId - duplicate author id
        Returns:
        fake name to be used for author duplicate
      • getAuthorIdFromNameMarkerPattern

        @Nullable
        public static @Nullable Pair<Long,​Long> getAuthorIdFromNameMarkerPattern​(@NotNull
                                                                                       @NotNull String authorName)
        Decode original and duplicate author ids from the fake author name
        Parameters:
        authorName - fake author name to be decoded
        Returns:
        pair of originalId and duplicateId or null if name cannot be decoded