@PublicApi public final class PlanKeys extends Object
Modifier and Type | Field and Description |
---|---|
static com.google.common.base.Function<PlanKey,PlanKey> |
CHAIN_KEY_FROM_JOB_KEY |
static com.google.common.base.Function<? super PlanResultKey,? extends PlanResultKey> |
chainResultKeyFromJobResultKey
Deprecated.
since 5.10, use PlanKeys::getChainResultKey
|
static com.google.common.base.Function<PlanKey,String> |
PARTIAL_JOB_KEY_FROM_JOB_KEY |
static Comparator<PlanKey> |
PLAN_KEY_COMPARATOR |
static com.google.common.base.Function<PlanKey,String> |
planKeyToKey
Deprecated.
since 5.10, use PlanKey::getKey
|
static com.google.common.base.Function<? super PlanResultKey,? extends PlanResultKey> |
REMOVE_DELETION_MARKER |
static char |
SEP |
static com.google.common.base.Function<PlanKey,String> |
SHORT_KEY_FROM_PLAN_KEY |
Modifier and Type | Method and Description |
---|---|
static PlanKey |
asDeletedPlanKey(PlanKey planKey) |
static PlanKey |
asNonDeletedPlanKey(PlanKey planKey) |
static void |
assertSafeKey(String key) |
static com.atlassian.fugue.Option<Long> |
getBranchNumberSuffix(PlanKey chainKey,
PlanKey branchKey)
Extract numerical branch suffix
|
static PlanKey |
getChainKeyFromJobKey(PlanKey jobKey)
|
static PlanKey |
getChainKeyIfJobKey(PlanKey jobKey)
|
static PlanResultKey |
getChainResultKey(PlanResultKey planResultKey)
Creates a chain result key from job result key.
|
static PlanKey |
getJobKey(PlanKey chainPlanKey,
String jobKey)
|
static String |
getPartialJobKey(PlanKey jobKey)
Return a partial job key from a full job key, e.g.
|
static PlanKey |
getPlanKey(String planKey)
Creates a
PlanKey from its string form 'BAM-BOO' or from the result key form 'BAM-BOO-123' |
static PlanKey |
getPlanKey(String projectKey,
String buildKey)
Creates a
PlanKey from project key and build key |
static PlanKey |
getPlanKey(String projectKey,
String chainKey,
String buildKey)
Creates a
PlanKey from project key, parent chain key and build key |
static String |
getPlanKeyPart(PlanKey planKey)
Returns plan key part for given
PlanKey |
static String |
getPlanKeyPart(PlanResultKey planResultKey)
Returns plan key part for given
PlanResultKey |
static PlanResultKey |
getPlanResultKey(PlanKey planKey,
int buildNumber)
Creates a
PlanResultKey from the given PlanKey and buildNumber |
static PlanResultKey |
getPlanResultKey(String planResultKey)
Creates a
PlanResultKey from its string form 'BAM-BOO-123' |
static PlanResultKey |
getPlanResultKey(String planKey,
int buildNumber)
Creates a
PlanResultKey from the given planKey and buildNumber |
static String |
getProjectKeyPart(PlanKey planKey)
Returns project key part for given
PlanKey |
static String |
getProjectKeyPart(PlanResultKey planResultKey)
Returns project key part for given
PlanResultKey |
static String |
getShortKeyFromPlanKey(PlanKey planKey)
Return a last part of the plan key, e.g PROJ-CHAIN would reduce CHAIN and PROJ-CHAIN-HOB would return JOB
|
static boolean |
isChainKey(PlanKey planKey)
|
static boolean |
isJobKey(PlanKey planKey)
|
static com.google.common.base.Function<PlanIdentifier,PlanKey> |
planKeyFromPlan()
Deprecated.
since 5.10 use PlanIdentifier::getPlanKey
|
static com.google.common.base.Function<PlanResultKey,PlanKey> |
planKeyFromPlanResultKey()
Deprecated.
since 5.10, use PlanResultKey::getPlanKey
|
static com.google.common.base.Function<String,PlanKey> |
planKeyFromString()
Deprecated.
since 5.10, use PlanKeys::getPlanKey
|
static com.google.common.base.Function<PlanResultKey,String> |
planKeyStringFromPlanResultKey()
Deprecated.
since 5.10, use PlanResultKey::getPlanKey and PlanKey::getKey
|
static com.google.common.base.Function<PlanKey,String> |
planKeyToString()
Deprecated.
since 5.10, use PlanKey::getKey
|
static com.google.common.base.Function<String,PlanResultKey> |
planResultKeyFromString()
Deprecated.
since 5.10, use PlanKeys::getPlanResultKey
|
static PlanKey |
updatePlanKeyInBranchKey(PlanKey branchKey,
PlanKey originalPlanKey,
PlanKey newPlanKey)
Update plan key part in branch key
|
public static final char SEP
public static com.google.common.base.Function<? super PlanResultKey,? extends PlanResultKey> REMOVE_DELETION_MARKER
@Deprecated public static com.google.common.base.Function<PlanKey,String> planKeyToKey
@Deprecated public static com.google.common.base.Function<? super PlanResultKey,? extends PlanResultKey> chainResultKeyFromJobResultKey
public static final com.google.common.base.Function<PlanKey,PlanKey> CHAIN_KEY_FROM_JOB_KEY
public static final com.google.common.base.Function<PlanKey,String> PARTIAL_JOB_KEY_FROM_JOB_KEY
public static final Comparator<PlanKey> PLAN_KEY_COMPARATOR
@Deprecated public static com.google.common.base.Function<PlanResultKey,PlanKey> planKeyFromPlanResultKey()
@Deprecated public static com.google.common.base.Function<PlanResultKey,String> planKeyStringFromPlanResultKey()
@Deprecated public static com.google.common.base.Function<String,PlanKey> planKeyFromString()
@Deprecated public static com.google.common.base.Function<String,PlanResultKey> planResultKeyFromString()
@Deprecated public static com.google.common.base.Function<PlanKey,String> planKeyToString()
@Deprecated public static com.google.common.base.Function<PlanIdentifier,PlanKey> planKeyFromPlan()
public static boolean isChainKey(@NotNull PlanKey planKey)
planKey
- public static boolean isJobKey(@NotNull PlanKey planKey)
planKey
- public static PlanKey getPlanKey(@NotNull String projectKey, @NotNull String buildKey)
PlanKey
from project key and build keyprojectKey
- buildKey
- @NotNull public static String getProjectKeyPart(@NotNull PlanKey planKey)
PlanKey
planKey
- @Nullable public static String getProjectKeyPart(@NotNull PlanResultKey planResultKey)
PlanResultKey
planResultKey
- @NotNull public static String getPlanKeyPart(@NotNull PlanKey planKey)
PlanKey
planKey
- @Nullable public static String getPlanKeyPart(@NotNull PlanResultKey planResultKey)
PlanResultKey
planResultKey
- @NotNull public static PlanKey getJobKey(@NotNull PlanKey chainPlanKey, @NotNull String jobKey)
Chain
key and a jobKey part to create a Job PlanKey
For example, BAM-REL and UNIT becomes BAM-REL-UNITchainPlanKey
- jobKey
- @NotNull public static PlanKey getChainKeyFromJobKey(@NotNull PlanKey jobKey)
Chain
key from a jobKey and creates new PlanKey
For example, BAM-REL-UNIT becomes BAM-RELjobKey
- IllegalArgumentException
- if the argument has incorrect format.@Nullable public static PlanKey getChainKeyIfJobKey(@NotNull PlanKey jobKey)
Chain
key from a jobKey and creates new PlanKey
For example, BAM-REL-UNIT becomes
BAM-REL
Returns a Chain key if the passed in key is a Job key, otherwise a null is returnedjobKey
- public static PlanKey getPlanKey(@NotNull String projectKey, @Nullable String chainKey, @NotNull String buildKey)
PlanKey
from project key, parent chain key and build keyprojectKey
- chainKey
- - if empty a key for top level plan is createdbuildKey
- @NotNull public static PlanKey getPlanKey(@NotNull String planKey)
PlanKey
from its string form 'BAM-BOO' or from the result key form 'BAM-BOO-123'planKey
- IllegalArgumentException
- if key could not be parsedpublic static PlanResultKey getPlanResultKey(String planResultKey)
PlanResultKey
from its string form 'BAM-BOO-123'planResultKey
- IllegalArgumentException
- if key could not be parsedpublic static PlanResultKey getPlanResultKey(@NotNull String planKey, int buildNumber)
PlanResultKey
from the given planKey and buildNumberplanKey
- buildNumber
- IllegalArgumentException
- if key could not be parsedpublic static PlanResultKey getPlanResultKey(PlanKey planKey, int buildNumber)
PlanResultKey
from the given PlanKey
and buildNumberplanKey
- buildNumber
- @NotNull public static PlanResultKey getChainResultKey(@NotNull PlanResultKey planResultKey)
planResultKey
- the job result key to convertpublic static String getPartialJobKey(PlanKey jobKey)
jobKey
- a full job keypublic static String getShortKeyFromPlanKey(PlanKey planKey)
planKey
- a full plan keypublic static void assertSafeKey(String key)
public static PlanKey updatePlanKeyInBranchKey(@NotNull PlanKey branchKey, @NotNull PlanKey originalPlanKey, @NotNull PlanKey newPlanKey)
branchKey
- branch key to be alteredoriginalPlanKey
- original plan keynewPlanKey
- new plan keypublic static com.atlassian.fugue.Option<Long> getBranchNumberSuffix(@NotNull PlanKey chainKey, @NotNull PlanKey branchKey)
chainKey
- chain keybranchKey
- branch keyIllegalArgumentException
- if the branch key doesn't start with chain keyNumberFormatException
- if the branch suffix is not proper numerical valueCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.