public final class PlanHelper extends Object
Modifier and Type | Method and Description |
---|---|
static Predicate<ImmutableChain> |
defaultRepositoryAsRootPredicate(long repositoryId)
passes chains when the default plan repository definition points to root definition with given id
|
static ImmutableJob |
getBranchedImmutableJob(ImmutableChain chainBranch,
ImmutableJob masterJob)
Searches for a corresponding job in a branch.
|
static @NotNull ImmutableChainStage |
getBranchedStage(ImmutableChain chainBranch,
ImmutableChainStage masterStage) |
static Stream<ImmutableJob> |
getBranchesForJob(@NotNull CachedPlanManager cachedPlanManager,
@NotNull ImmutableJob masterJob) |
static <T> T |
getConfigObject(@NotNull BuildDefinition planDefinition,
@NotNull String key,
@NotNull Class<T> clazz) |
static <T> T |
getConfigObject(@NotNull ImmutablePlan plan,
@NotNull String key,
@NotNull Class<T> clazz) |
static String |
getCurrentStatus(@NotNull ImmutablePlan plan) |
static @Nullable PlanRepositoryDefinition |
getDefaultPlanRepositoryDefinition(@NotNull ImmutablePlan plan) |
static @NotNull Set<PlanKey> |
getMasterAndBranchesKeys(@NotNull CachedPlanManager cachedPlanManager,
@NotNull PlanKey masterOrBranchKey)
Get keys of all branches and master plan.
|
static @NotNull Chain |
getMasterPlan(@NotNull Chain plan)
Get master plan if plan has master or passed plan otherwise.
|
static @NotNull ImmutableChain |
getMasterPlan(@NotNull ImmutableChain plan)
Get master plan if plan has master or passed plan otherwise.
|
static @NotNull ImmutablePlan |
getMasterPlan(@NotNull ImmutablePlan plan)
Get master plan if plan has master or passed plan otherwise.
|
static @NotNull PlanKey |
getMasterPlanKey(@NotNull ImmutablePlan plan)
Get planKey of master plan if plan has master or planKey of passed plan otherwise.
|
static long |
getPermissionPlanId(ImmutablePlan plan) |
static @NotNull Set<PlanKey> |
getPlanKeysOfBranchesSharingConfiguration(@NotNull CachedPlanManager cachedPlanManager,
@NotNull PlanKey masterOrBranchKey)
Get keys of all branches (including master plan if applicable) that share the configuration.
|
static PlanRepositoryDefinition |
getPlanRepositoryDefinitionById(@NotNull ImmutablePlan plan,
long id) |
static @NotNull LinkedHashMap<Long,PlanRepositoryDefinition> |
getPlanRepositoryDefinitionMap(@NotNull ImmutablePlan plan) |
static List<PlanRepositoryDefinition> |
getPlanRepositoryDefinitions(@NotNull ImmutablePlan plan) |
static List<PlanRepositoryDefinition> |
getPlanRepositoryDefinitionsByType(@NotNull ImmutablePlan plan,
@NotNull String pluginKey) |
static boolean |
hasMultipleBranches(@NotNull CachedPlanManager cachedPlanManager,
@NotNull PlanKey planKey) |
static boolean |
haveTheSameMaster(@NotNull CachedPlanManager cachedPlanManager,
@NotNull ImmutableChain masterOrBranchA,
@NotNull ImmutableChain masterOrBranchB) |
static boolean |
haveTheSameMaster(@NotNull CachedPlanManager cachedPlanManager,
@NotNull PlanKey masterOrBranchKeyA,
@NotNull PlanKey masterOrBranchKeyB) |
static boolean |
isDefault(@NotNull PlanRepositoryDefinition repositoryDefinition) |
static boolean |
isDivergentBranch(@NotNull ImmutableChain chain) |
static boolean |
isDivergentBranch(@NotNull ImmutablePlan plan) |
public static boolean isDivergentBranch(@NotNull @NotNull ImmutablePlan plan)
public static boolean isDivergentBranch(@NotNull @NotNull ImmutableChain chain)
@NotNull public static @NotNull LinkedHashMap<Long,PlanRepositoryDefinition> getPlanRepositoryDefinitionMap(@NotNull @NotNull ImmutablePlan plan)
public static List<PlanRepositoryDefinition> getPlanRepositoryDefinitions(@NotNull @NotNull ImmutablePlan plan)
public static List<PlanRepositoryDefinition> getPlanRepositoryDefinitionsByType(@NotNull @NotNull ImmutablePlan plan, @NotNull @NotNull String pluginKey)
public static PlanRepositoryDefinition getPlanRepositoryDefinitionById(@NotNull @NotNull ImmutablePlan plan, long id)
@Nullable public static @Nullable PlanRepositoryDefinition getDefaultPlanRepositoryDefinition(@NotNull @NotNull ImmutablePlan plan)
public static boolean isDefault(@NotNull @NotNull PlanRepositoryDefinition repositoryDefinition)
public static String getCurrentStatus(@NotNull @NotNull ImmutablePlan plan)
@NotNull public static @NotNull ImmutablePlan getMasterPlan(@NotNull @NotNull ImmutablePlan plan)
plan
- @NotNull public static @NotNull ImmutableChain getMasterPlan(@NotNull @NotNull ImmutableChain plan)
plan
- @NotNull public static @NotNull Chain getMasterPlan(@NotNull @NotNull Chain plan)
plan
- @NotNull public static @NotNull PlanKey getMasterPlanKey(@NotNull @NotNull ImmutablePlan plan)
plan
- public static ImmutableJob getBranchedImmutableJob(ImmutableChain chainBranch, ImmutableJob masterJob)
chainBranch
- branch where job has to be searchedmasterJob
- job which is to be found in a branchImmutableJob
or null if not found@NotNull public static @NotNull ImmutableChainStage getBranchedStage(ImmutableChain chainBranch, ImmutableChainStage masterStage)
@Nullable public static <T> T getConfigObject(@NotNull @NotNull ImmutablePlan plan, @NotNull @NotNull String key, @NotNull @NotNull Class<T> clazz)
@Nullable public static <T> T getConfigObject(@NotNull @NotNull BuildDefinition planDefinition, @NotNull @NotNull String key, @NotNull @NotNull Class<T> clazz)
public static long getPermissionPlanId(ImmutablePlan plan)
@NotNull public static @NotNull Set<PlanKey> getMasterAndBranchesKeys(@NotNull @NotNull CachedPlanManager cachedPlanManager, @NotNull @NotNull PlanKey masterOrBranchKey)
cachedPlanManager
- cachedPlanManager beanmasterOrBranchKey
- key of either master plan or one of the branches in the family@NotNull public static @NotNull Set<PlanKey> getPlanKeysOfBranchesSharingConfiguration(@NotNull @NotNull CachedPlanManager cachedPlanManager, @NotNull @NotNull PlanKey masterOrBranchKey)
cachedPlanManager
- cachedPlanManager beanmasterOrBranchKey
- key of either master plan or one of the branches in the familypublic static Stream<ImmutableJob> getBranchesForJob(@NotNull @NotNull CachedPlanManager cachedPlanManager, @NotNull @NotNull ImmutableJob masterJob)
public static boolean haveTheSameMaster(@NotNull @NotNull CachedPlanManager cachedPlanManager, @NotNull @NotNull PlanKey masterOrBranchKeyA, @NotNull @NotNull PlanKey masterOrBranchKeyB)
public static boolean haveTheSameMaster(@NotNull @NotNull CachedPlanManager cachedPlanManager, @NotNull @NotNull ImmutableChain masterOrBranchA, @NotNull @NotNull ImmutableChain masterOrBranchB)
public static boolean hasMultipleBranches(@NotNull @NotNull CachedPlanManager cachedPlanManager, @NotNull @NotNull PlanKey planKey)
public static Predicate<ImmutableChain> defaultRepositoryAsRootPredicate(long repositoryId)
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.