3 * Copyright (C) 2009-2019 SonarSource SA
4 * mailto:info AT sonarsource DOT com
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 package org.sonar.ce.task.projectanalysis.analysis;
23 import javax.annotation.CheckForNull;
24 import javax.annotation.Nullable;
25 import org.junit.rules.ExternalResource;
26 import org.sonar.server.project.Project;
27 import org.sonar.server.qualityprofile.QualityProfile;
29 public class MutableAnalysisMetadataHolderRule extends ExternalResource implements MutableAnalysisMetadataHolder {
31 private AnalysisMetadataHolderImpl delegate = new AnalysisMetadataHolderImpl();
34 protected void after() {
35 delegate = new AnalysisMetadataHolderImpl();
39 public boolean isOrganizationsEnabled() {
40 return delegate.isOrganizationsEnabled();
44 public MutableAnalysisMetadataHolderRule setOrganizationsEnabled(boolean isOrganizationsEnabled) {
45 delegate.setOrganizationsEnabled(isOrganizationsEnabled);
50 public MutableAnalysisMetadataHolderRule setOrganization(Organization organization) {
51 delegate.setOrganization(organization);
56 public Organization getOrganization() {
57 return delegate.getOrganization();
60 public MutableAnalysisMetadataHolderRule setUuid(String s) {
66 public String getUuid() {
67 return delegate.getUuid();
70 public MutableAnalysisMetadataHolderRule setAnalysisDate(long date) {
71 delegate.setAnalysisDate(date);
76 public long getAnalysisDate() {
77 return delegate.getAnalysisDate();
81 public boolean hasAnalysisDateBeenSet() {
82 return delegate.hasAnalysisDateBeenSet();
86 public boolean isFirstAnalysis() {
87 return delegate.isFirstAnalysis();
91 public MutableAnalysisMetadataHolderRule setBaseAnalysis(@Nullable Analysis baseAnalysis) {
92 delegate.setBaseAnalysis(baseAnalysis);
98 public Analysis getBaseAnalysis() {
99 return delegate.getBaseAnalysis();
103 public boolean isCrossProjectDuplicationEnabled() {
104 return delegate.isCrossProjectDuplicationEnabled();
108 public MutableAnalysisMetadataHolderRule setCrossProjectDuplicationEnabled(boolean isCrossProjectDuplicationEnabled) {
109 delegate.setCrossProjectDuplicationEnabled(isCrossProjectDuplicationEnabled);
114 public Branch getBranch() {
115 return delegate.getBranch();
119 public MutableAnalysisMetadataHolderRule setBranch(Branch branch) {
120 delegate.setBranch(branch);
125 public String getPullRequestKey() {
126 return delegate.getPullRequestKey();
130 public MutableAnalysisMetadataHolder setPullRequestKey(String pullRequestKey) {
131 delegate.setPullRequestKey(pullRequestKey);
136 public MutableAnalysisMetadataHolderRule setProject(@Nullable Project project) {
137 delegate.setProject(project);
142 public Project getProject() {
143 return delegate.getProject();
147 public MutableAnalysisMetadataHolderRule setRootComponentRef(int rootComponentRef) {
148 delegate.setRootComponentRef(rootComponentRef);
153 public int getRootComponentRef() {
154 return delegate.getRootComponentRef();
158 public MutableAnalysisMetadataHolder setQProfilesByLanguage(Map<String, QualityProfile> qprofilesByLanguage) {
159 delegate.setQProfilesByLanguage(qprofilesByLanguage);
164 public Map<String, QualityProfile> getQProfilesByLanguage() {
165 return delegate.getQProfilesByLanguage();
169 public MutableAnalysisMetadataHolder setScannerPluginsByKey(Map<String, ScannerPlugin> plugins) {
170 delegate.setScannerPluginsByKey(plugins);
175 public Map<String, ScannerPlugin> getScannerPluginsByKey() {
176 return delegate.getScannerPluginsByKey();
180 public boolean isShortLivingBranch() {
181 return delegate.isShortLivingBranch();
185 public boolean isLongLivingBranch() {
186 return delegate.isLongLivingBranch();
190 public boolean isPullRequest() {
191 return delegate.isPullRequest();