Class AbstractPullRequestFilter<T>
- java.lang.Object
-
- jenkins.scm.api.trait.SCMHeadFilter
-
- org.jenkinsci.plugins.bitbucket.pullrequests.filter.filters.AbstractPullRequestFilter<T>
-
- Type Parameters:
T- data type to validation
- Direct Known Subclasses:
PullRequestSourceBranchMatchesFilter,PullRequestTargetBranchMatchesFilter,PullRequestTitlePhraseExistsFilter
public abstract class AbstractPullRequestFilter<T> extends jenkins.scm.api.trait.SCMHeadFilterASCMHeadfilter to exclusion the pull requests due to not match by user filter.- Since:
- 0.1.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPullRequestFilter(TypeFilter<T> filter)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract TgetData(com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequest pullRequest)Extracts data from pull requests to validate.protected TypeFilter<T>getFilter()Return instance of a filter to validate the data.protected abstract StringgetMessage(com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequest pullRequest)Prepare a message for user to logs.protected booleanisAccepted(com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequest pullRequest)Validates the pull requests is accepted by the filter.booleanisExcluded(jenkins.scm.api.trait.SCMSourceRequest request, jenkins.scm.api.SCMHead head)
-
-
-
Constructor Detail
-
AbstractPullRequestFilter
protected AbstractPullRequestFilter(TypeFilter<T> filter)
Constructor.- Parameters:
filter-TypeFilterto validate the data
-
-
Method Detail
-
isExcluded
public boolean isExcluded(@Nonnull jenkins.scm.api.trait.SCMSourceRequest request, @Nonnull jenkins.scm.api.SCMHead head) throws IOException, InterruptedException- Specified by:
isExcludedin classjenkins.scm.api.trait.SCMHeadFilter- Throws:
IOExceptionInterruptedException
-
isAccepted
protected boolean isAccepted(com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequest pullRequest)
Validates the pull requests is accepted by the filter.- Parameters:
pullRequest- theBitbucketPullRequest- Returns:
trueif and only if the pull requests was verified positive by the filter
-
getFilter
protected TypeFilter<T> getFilter()
Return instance of a filter to validate the data.- Returns:
TypeFilterto validate the data
-
getData
protected abstract T getData(com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequest pullRequest)
Extracts data from pull requests to validate.- Parameters:
pullRequest- theBitbucketPullRequest- Returns:
- extracted data to validation
-
getMessage
protected abstract String getMessage(com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequest pullRequest)
Prepare a message for user to logs.- Parameters:
pullRequest- theBitbucketPullRequest- Returns:
- a message for user
-
-