com.atlassian.bamboo.author
Class AuthorDuplicateNameHelper

java.lang.Object
  extended by com.atlassian.bamboo.author.AuthorDuplicateNameHelper

public class AuthorDuplicateNameHelper
extends java.lang.Object

Utility class for BAM-5701


Constructor Summary
AuthorDuplicateNameHelper()
           
 
Method Summary
static java.lang.String createNameMarkerPattern(long originalId, long duplicateId)
          Create fake author name: "originalAuthorId;duplicateAuthorId".
static Pair<java.lang.Long,java.lang.Long> getAuthorIdFromNameMarkerPattern(java.lang.String authorName)
          Decode original and duplicate author ids from the fake author name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorDuplicateNameHelper

public AuthorDuplicateNameHelper()
Method Detail

createNameMarkerPattern

public static java.lang.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 Pair<java.lang.Long,java.lang.Long> getAuthorIdFromNameMarkerPattern(@NotNull
                                                                                            java.lang.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


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.