Class GerritProject
- java.lang.Object
-
- com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject
-
- All Implemented Interfaces:
Describable<GerritProject>
public class GerritProject extends Object implements Describable<GerritProject>
Base settings for one matcher rule of a Gerrit project.- Author:
- Robert Sandell <robert.sandell@sonyericsson.com>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GerritProject.DescriptorImpl
Descriptor allowing for communication within the Repeatable.
-
Constructor Summary
Constructors Constructor Description GerritProject()
Default empty constructor.GerritProject(CompareType compareType, String pattern, List<Branch> branches, List<Topic> topics, List<FilePath> filePaths, List<FilePath> forbiddenFilePaths, boolean disableStrictForbiddenFileVerification)
DataBound Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description List<Branch>
getBranches()
The list of branch-rules.CompareType
getCompareType()
Which algorithm-type to use with the pattern.Descriptor<GerritProject>
getDescriptor()
List<FilePath>
getFilePaths()
The list of filepath-rules.List<FilePath>
getForbiddenFilePaths()
The list of the forbidden file-path rules.List<Hashtag>
getHashtags()
String
getPattern()
The pattern for the project-name to match on.List<Topic>
getTopics()
The list of topic-rules.boolean
isDisableStrictForbiddenFileVerification()
Whether to disable strict verification of forbidden files.boolean
isInteresting(com.sonymobile.tools.gerrit.gerritevents.dto.attr.Change change)
Compares the project and branch to see if the rules specified is a match.boolean
isInteresting(com.sonymobile.tools.gerrit.gerritevents.dto.attr.Change change, Supplier<List<String>> files)
Compares the project, branch and files to see if the rules specified is a match.boolean
isInteresting(String project, String branch, String topic)
Deprecated.boolean
isInteresting(String project, String branch, String topic, Supplier<List<String>> files)
Deprecated.void
setBranches(List<Branch> branches)
The list of branch-rules.void
setCompareType(CompareType compareType)
Which algorithm-type to use with the pattern.void
setDisableStrictForbiddenFileVerification(boolean disableStrictForbiddenFileVerification)
Set whether to disable strict verification of forbidden files.void
setFilePaths(List<FilePath> filePaths)
The list of filepath-rules.void
setForbiddenFilePaths(List<FilePath> forbiddenFilePaths)
The list of the forbidden file-path rules.void
setHashtags(List<Hashtag> hashtags)
The list of the hashtags-rules.void
setPattern(String pattern)
The pattern for the project-name to match on.void
setTopics(List<Topic> topics)
The list of topic-rules.
-
-
-
Constructor Detail
-
GerritProject
public GerritProject()
Default empty constructor.
-
GerritProject
@DataBoundConstructor public GerritProject(CompareType compareType, String pattern, List<Branch> branches, List<Topic> topics, List<FilePath> filePaths, List<FilePath> forbiddenFilePaths, boolean disableStrictForbiddenFileVerification)
DataBound Constructor.- Parameters:
compareType
- the compareTypepattern
- the project-name patternbranches
- the branch-rulestopics
- the topic-rulesfilePaths
- the file-path rules.forbiddenFilePaths
- the forbidden file-path rules.disableStrictForbiddenFileVerification
- whether to be strict or not.
-
-
Method Detail
-
isDisableStrictForbiddenFileVerification
public boolean isDisableStrictForbiddenFileVerification()
Whether to disable strict verification of forbidden files.- Returns:
- true if disabled.
-
setDisableStrictForbiddenFileVerification
public void setDisableStrictForbiddenFileVerification(boolean disableStrictForbiddenFileVerification)
Set whether to disable strict verification of forbidden files.- Parameters:
disableStrictForbiddenFileVerification
- true to disable.
-
getCompareType
public CompareType getCompareType()
Which algorithm-type to use with the pattern.- Returns:
- the compareType
-
setCompareType
public void setCompareType(CompareType compareType)
Which algorithm-type to use with the pattern.- Parameters:
compareType
- the compareType
-
getPattern
public String getPattern()
The pattern for the project-name to match on.- Returns:
- the pattern
-
setPattern
public void setPattern(String pattern)
The pattern for the project-name to match on.- Parameters:
pattern
- the pattern
-
setBranches
public void setBranches(List<Branch> branches)
The list of branch-rules.- Parameters:
branches
- the branch-rules
-
getFilePaths
public List<FilePath> getFilePaths()
The list of filepath-rules.- Returns:
- the filepath-rules
-
setFilePaths
public void setFilePaths(List<FilePath> filePaths)
The list of filepath-rules.- Parameters:
filePaths
- the filepath-rules
-
setTopics
public void setTopics(List<Topic> topics)
The list of topic-rules.- Parameters:
topics
- the topic-rules
-
setHashtags
@DataBoundSetter public void setHashtags(List<Hashtag> hashtags)
The list of the hashtags-rules.- Parameters:
hashtags
- the hashtags-rules
-
getForbiddenFilePaths
public List<FilePath> getForbiddenFilePaths()
The list of the forbidden file-path rules.- Returns:
- the forbidden file-path rules.
-
setForbiddenFilePaths
public void setForbiddenFilePaths(List<FilePath> forbiddenFilePaths)
The list of the forbidden file-path rules.- Parameters:
forbiddenFilePaths
- the forbidden file-path rules.
-
isInteresting
@Deprecated public boolean isInteresting(String project, String branch, String topic, Supplier<List<String>> files)
Deprecated.Compares the project, branch and files to see if the rules specified is a match.- Parameters:
project
- the Gerrit projectbranch
- the branch.topic
- the topic.files
- a closure which returns the list of files in the change.- Returns:
- true is the rules match.
-
isInteresting
@Deprecated public boolean isInteresting(String project, String branch, String topic)
Deprecated.Compares the project and branch to see if the rules specified is a match.- Parameters:
project
- the Gerrit projectbranch
- the branch.topic
- the topic.- Returns:
- true is the rules match.
-
isInteresting
public boolean isInteresting(com.sonymobile.tools.gerrit.gerritevents.dto.attr.Change change, Supplier<List<String>> files)
Compares the project, branch and files to see if the rules specified is a match.- Parameters:
change
- gerrit change info.files
- a closure which returns the list of files in the change.- Returns:
- true is the rules match.
-
isInteresting
public boolean isInteresting(com.sonymobile.tools.gerrit.gerritevents.dto.attr.Change change)
Compares the project and branch to see if the rules specified is a match.- Parameters:
change
- gerrit change info.- Returns:
- true is the rules match.
-
getDescriptor
public Descriptor<GerritProject> getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<GerritProject>
-
-