com.atlassian.bamboo.utils
Class BambooPredicates

java.lang.Object
  extended by com.atlassian.bamboo.utils.BambooPredicates

public class BambooPredicates
extends java.lang.Object


Method Summary
static com.google.common.base.Predicate<BuildAgent> buildAgentIsActive()
           
static com.google.common.base.Predicate<BuildAgent> buildAgentIsActiveAndEnabled()
           
static com.google.common.base.Predicate<BuildAgent> buildAgentIsBusy()
           
static com.google.common.base.Predicate<BuildAgent> buildAgentIsEnabled()
           
static com.google.common.base.Predicate<? super RepositoryDefinition> buildTrigger()
           
static com.google.common.base.Predicate<Capability> capabilityKeyStartsWith(java.lang.String prefix)
          Get a predicate that returns true for Capability which key starts with given prefix
static com.google.common.base.Predicate<PlanDependency> dependencyChildIsChain()
           
static com.google.common.base.Predicate<PlanDependency> dependencyNotEditable()
           
static com.google.common.base.Predicate<PlanDependency> dependencyParentIsChain()
           
static com.google.common.base.Predicate<ElasticInstanceSchedule> elasticInstanceScheduleIsEnabled()
           
static com.google.common.base.Predicate<ImmutableDeletable> getNotDeletedPredicate()
           
static com.google.common.base.Predicate<BambooIdProvider> hasBambooObjectEqualId(BambooIdProvider bambooObject)
           
static com.google.common.base.Predicate<BambooIdProvider> hasBambooObjectEqualId(long id)
           
static com.google.common.base.Predicate<NameProvider> hasNameProviderEqualName(java.lang.String name)
           
static com.google.common.base.Predicate<TaskDefinition> hasTaskDefinitionEqualId(long id)
           
static
<T> com.google.common.base.Predicate<? super java.lang.Class<? extends T>>
isAssignableFrom(java.lang.Class clazz)
           
static com.google.common.base.Predicate<TaskDefinition> isFinalizingTaskDefinition()
          Get a predicate that returns true for TaskDefinition which are marked as "finalizing"
static com.google.common.base.Predicate<TaskIdentifier> isTaskDefinitionPluginKeyEqual(java.lang.String pluginKey)
          Get a predicate that returns true for TaskDefinition that has equal pluginKey
static com.google.common.base.Predicate<TaskResult> isTaskResultPluginKeyEqual(java.lang.String pluginKey)
          Get a predicate that returns true for TaskResult which TaskDefinition has equal pluginKey
static com.google.common.base.Predicate<Labelling> labelNameIn(java.lang.Iterable<java.lang.String> labelNames)
           
static
<T> com.google.common.base.Predicate<T>
matcherPredicate(org.hamcrest.Matcher<T> matcher)
           
static com.google.common.base.Predicate<java.lang.reflect.Method> methodHasNoArguments()
          Get a predicate that returns true for Methods which have no arguments
static com.google.common.base.Predicate<java.lang.reflect.Method> methodNameMatchesPattern(java.util.regex.Pattern pattern)
          Get a predicate that returns true for Methods which name matched given pattern
static com.google.common.base.Predicate<Project> projectIsNotEmpty(PlanManager planManager)
          Return predicate for filtering not empty projects (those which contain at least 1 plan)
static com.google.common.base.Predicate<ResultsSummary> resultsSummaryIsFailed()
           
static com.google.common.base.Predicate<ResultsSummary> resultsSummaryIsInProgress()
           
static com.google.common.base.Predicate<ResultsSummary> resultsSummaryIsNotBuilt()
           
static com.google.common.base.Predicate<ResultsSummary> resultsSummaryIsSuccessful()
           
static com.google.common.base.Predicate<java.lang.String> startsWith(java.lang.String prefix)
           
static com.google.common.base.Predicate<java.lang.String> stringIsNotEmpty()
           
static com.google.common.base.Predicate<SystemProperty> systemPropertyHasValue()
           
static com.google.common.base.Predicate<TestClassResult> testResultsInteresting()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNotDeletedPredicate

@NotNull
public static com.google.common.base.Predicate<ImmutableDeletable> getNotDeletedPredicate()

stringIsNotEmpty

@NotNull
public static com.google.common.base.Predicate<java.lang.String> stringIsNotEmpty()

startsWith

@NotNull
public static com.google.common.base.Predicate<java.lang.String> startsWith(@NotNull
                                                                                    java.lang.String prefix)

resultsSummaryIsFailed

@NotNull
public static com.google.common.base.Predicate<ResultsSummary> resultsSummaryIsFailed()

resultsSummaryIsNotBuilt

@NotNull
public static com.google.common.base.Predicate<ResultsSummary> resultsSummaryIsNotBuilt()

resultsSummaryIsSuccessful

@NotNull
public static com.google.common.base.Predicate<ResultsSummary> resultsSummaryIsSuccessful()

resultsSummaryIsInProgress

@NotNull
public static com.google.common.base.Predicate<ResultsSummary> resultsSummaryIsInProgress()

isAssignableFrom

@NotNull
public static <T> com.google.common.base.Predicate<? super java.lang.Class<? extends T>> isAssignableFrom(java.lang.Class clazz)

projectIsNotEmpty

@NotNull
public static com.google.common.base.Predicate<Project> projectIsNotEmpty(@NotNull
                                                                                  PlanManager planManager)
Return predicate for filtering not empty projects (those which contain at least 1 plan)

Parameters:
planManager - plan manager component
Returns:
Predicate object

dependencyChildIsChain

@NotNull
public static com.google.common.base.Predicate<PlanDependency> dependencyChildIsChain()

dependencyParentIsChain

@NotNull
public static com.google.common.base.Predicate<PlanDependency> dependencyParentIsChain()

dependencyNotEditable

@NotNull
public static com.google.common.base.Predicate<PlanDependency> dependencyNotEditable()

testResultsInteresting

@NotNull
public static com.google.common.base.Predicate<TestClassResult> testResultsInteresting()

labelNameIn

@NotNull
public static com.google.common.base.Predicate<Labelling> labelNameIn(@NotNull
                                                                              java.lang.Iterable<java.lang.String> labelNames)

buildAgentIsActive

@NotNull
public static com.google.common.base.Predicate<BuildAgent> buildAgentIsActive()

buildAgentIsActiveAndEnabled

@NotNull
public static com.google.common.base.Predicate<BuildAgent> buildAgentIsActiveAndEnabled()

buildAgentIsBusy

@NotNull
public static com.google.common.base.Predicate<BuildAgent> buildAgentIsBusy()

buildAgentIsEnabled

@NotNull
public static com.google.common.base.Predicate<BuildAgent> buildAgentIsEnabled()

elasticInstanceScheduleIsEnabled

@NotNull
public static com.google.common.base.Predicate<ElasticInstanceSchedule> elasticInstanceScheduleIsEnabled()

systemPropertyHasValue

@NotNull
public static com.google.common.base.Predicate<SystemProperty> systemPropertyHasValue()

isFinalizingTaskDefinition

public static com.google.common.base.Predicate<TaskDefinition> isFinalizingTaskDefinition()
Get a predicate that returns true for TaskDefinition which are marked as "finalizing"

Returns:
Predicate object

hasTaskDefinitionEqualId

public static com.google.common.base.Predicate<TaskDefinition> hasTaskDefinitionEqualId(long id)

isTaskDefinitionPluginKeyEqual

public static com.google.common.base.Predicate<TaskIdentifier> isTaskDefinitionPluginKeyEqual(@NotNull
                                                                                              java.lang.String pluginKey)
Get a predicate that returns true for TaskDefinition that has equal pluginKey

Parameters:
pluginKey - id to be matched in TaskDefinition
Returns:
Predicate object

isTaskResultPluginKeyEqual

public static com.google.common.base.Predicate<TaskResult> isTaskResultPluginKeyEqual(@NotNull
                                                                                      java.lang.String pluginKey)
Get a predicate that returns true for TaskResult which TaskDefinition has equal pluginKey

Parameters:
pluginKey - id to be matched in TaskDefinition
Returns:
Predicate object

capabilityKeyStartsWith

public static com.google.common.base.Predicate<Capability> capabilityKeyStartsWith(@NotNull
                                                                                   java.lang.String prefix)
Get a predicate that returns true for Capability which key starts with given prefix

Parameters:
prefix - prefix to be matched in Capability
Returns:
Predicate object

methodHasNoArguments

public static com.google.common.base.Predicate<java.lang.reflect.Method> methodHasNoArguments()
Get a predicate that returns true for Methods which have no arguments

Returns:
Predicate object

methodNameMatchesPattern

public static com.google.common.base.Predicate<java.lang.reflect.Method> methodNameMatchesPattern(java.util.regex.Pattern pattern)
Get a predicate that returns true for Methods which name matched given pattern

Parameters:
pattern - pattern to be matched against method name
Returns:
Predicate object

buildTrigger

public static com.google.common.base.Predicate<? super RepositoryDefinition> buildTrigger()

hasBambooObjectEqualId

public static com.google.common.base.Predicate<BambooIdProvider> hasBambooObjectEqualId(@NotNull
                                                                                        BambooIdProvider bambooObject)

hasBambooObjectEqualId

public static com.google.common.base.Predicate<BambooIdProvider> hasBambooObjectEqualId(long id)

hasNameProviderEqualName

public static com.google.common.base.Predicate<NameProvider> hasNameProviderEqualName(java.lang.String name)

matcherPredicate

public static <T> com.google.common.base.Predicate<T> matcherPredicate(@NotNull
                                                                       org.hamcrest.Matcher<T> matcher)


Copyright © 2012 Atlassian. All Rights Reserved.