Package com.atlassian.bamboo.plan
Class PlanPredicates
- java.lang.Object
-
- com.atlassian.bamboo.plan.PlanPredicates
-
public class PlanPredicates extends Object
-
-
Constructor Summary
Constructors Constructor Description PlanPredicates()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Predicate<PlanIdentifier>
hasEqualBuildName(@NotNull String name)
static Predicate<PlanIdentifier>
hasEqualPlanKey(@NotNull PlanKey planKey)
static <T extends ImmutableChain>
booleanhasJobs(T chain)
static <T extends ImmutablePlan>
Predicate<T>isBranchOf(@NotNull PlanIdentifier master)
static boolean
isCloverEnabled(ImmutablePlan plan)
Check if plan is Clover enabled.static Predicate<ImmutablePlan>
isFavourite(@NotNull LabelManager labelManager, @NotNull com.atlassian.user.User user)
Get a predicate that returns true for Plans that are marked as favourite for a given user.static Predicate<ImmutablePlan>
isMyBranch(com.atlassian.user.User user)
Get a predicate that returns true for branches that "belong" to a user.static boolean
planIsMaster(ImmutablePlan plan)
static Predicate<ImmutablePlan>
withEqualProjectKey(Project project)
-
-
-
Method Detail
-
isCloverEnabled
public static boolean isCloverEnabled(ImmutablePlan plan)
Check if plan is Clover enabled. For chains it will return true if any of its Jobs is Clover enabled.
-
isFavourite
public static Predicate<ImmutablePlan> isFavourite(@NotNull @NotNull LabelManager labelManager, @NotNull @NotNull com.atlassian.user.User user)
Get a predicate that returns true for Plans that are marked as favourite for a given user.- Parameters:
labelManager
-LabelManager
user
-User
whose favourites would be tested- Returns:
- Predicate object
- Throws:
NullPointerException
- when it operates on a null element
-
isMyBranch
public static Predicate<ImmutablePlan> isMyBranch(com.atlassian.user.User user)
Get a predicate that returns true for branches that "belong" to a user.- Parameters:
user
-User
whose branches would be tested- Returns:
- Predicate object
- Throws:
NullPointerException
- when it operates on a null element
-
planIsMaster
public static boolean planIsMaster(ImmutablePlan plan)
-
withEqualProjectKey
public static Predicate<ImmutablePlan> withEqualProjectKey(Project project)
-
hasEqualPlanKey
public static Predicate<PlanIdentifier> hasEqualPlanKey(@NotNull @NotNull PlanKey planKey)
-
hasEqualBuildName
public static Predicate<PlanIdentifier> hasEqualBuildName(@NotNull @NotNull String name)
-
isBranchOf
public static <T extends ImmutablePlan> Predicate<T> isBranchOf(@NotNull @NotNull PlanIdentifier master)
-
hasJobs
public static <T extends ImmutableChain> boolean hasJobs(@NotNull T chain)
-
-