com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data
Class GerritProject

java.lang.Object
  extended by com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject
All Implemented Interfaces:
hudson.model.Describable<GerritProject>

public class GerritProject
extends Object
implements hudson.model.Describable<GerritProject>

Base settings for one matcher rule of a Gerrit project.

Author:
Robert Sandell <robert.sandell@sonyericsson.com>

Nested Class Summary
static class GerritProject.DescriptorImpl
          Descriptor allowing for communication within the Repeatable.
 
Constructor Summary
GerritProject()
          Default empty constructor.
GerritProject(CompareType compareType, String pattern, List<Branch> branches, List<Topic> topics, List<FilePath> filePaths, List<FilePath> forbiddenFilePaths)
          DataBound Constructor.
 
Method Summary
 List<Branch> getBranches()
          The list of branch-rules.
 CompareType getCompareType()
          Which algorithm-type to use with the pattern.
 hudson.model.Descriptor<GerritProject> getDescriptor()
           
 List<FilePath> getFilePaths()
          The list of filepath-rules.
 List<FilePath> getForbiddenFilePaths()
          The list of the forbidden file-path rules.
 String getPattern()
          The pattern for the project-name to match on.
 List<Topic> getTopics()
          The list of topic-rules.
 boolean isInteresting(String project, String branch, String topic)
          Compares the project and branch to see if the rules specified is a match.
 boolean isInteresting(String project, String branch, String topic, List<String> files)
          Compares the project, branch and files to see if the rules specified is a match.
 void setBranches(List<Branch> branches)
          The list of branch-rules.
 void setCompareType(CompareType compareType)
          Which algorithm-type to use with the pattern.
 void setFilePaths(List<FilePath> filePaths)
          The list of filepath-rules.
 void setForbiddenFilePaths(List<FilePath> forbiddenFilePaths)
          The list of the forbidden file-path rules.
 void setPattern(String pattern)
          The pattern for the project-name to match on.
 void setTopics(List<Topic> topics)
          The list of topic-rules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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)
DataBound Constructor.

Parameters:
compareType - the compareType
pattern - the project-name pattern
branches - the branch-rules
topics - the topic-rules
filePaths - the file-path rules.
forbiddenFilePaths - the forbidden file-path rules.
Method Detail

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

getBranches

public List<Branch> getBranches()
The list of branch-rules.

Returns:
the branch-rules

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

getTopics

public List<Topic> getTopics()
The list of topic-rules.

Returns:
the topic-rules

setTopics

public void setTopics(List<Topic> topics)
The list of topic-rules.

Parameters:
topics - the topic-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

public boolean isInteresting(String project,
                             String branch,
                             String topic,
                             List<String> files)
Compares the project, branch and files to see if the rules specified is a match.

Parameters:
project - the Gerrit project
branch - the branch.
topic - the topic.
files - the files.
Returns:
true is the rules match.

isInteresting

public boolean isInteresting(String project,
                             String branch,
                             String topic)
Compares the project and branch to see if the rules specified is a match.

Parameters:
project - the Gerrit project
branch - the branch.
topic - the topic.
Returns:
true is the rules match.

getDescriptor

public hudson.model.Descriptor<GerritProject> getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<GerritProject>


Copyright © 2004-2014. All Rights Reserved.