3 * Copyright (C) 2009-2017 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.server.computation.task.projectanalysis.analysis;
23 import java.util.Optional;
24 import javax.annotation.CheckForNull;
25 import javax.annotation.Nullable;
26 import org.junit.rules.ExternalResource;
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 MutableAnalysisMetadataHolderRule setOrganization(Organization organization) {
40 delegate.setOrganization(organization);
45 public Organization getOrganization() {
46 return delegate.getOrganization();
49 public MutableAnalysisMetadataHolderRule setUuid(String s) {
55 public String getUuid() {
56 return delegate.getUuid();
59 public MutableAnalysisMetadataHolderRule setAnalysisDate(long date) {
60 delegate.setAnalysisDate(date);
65 public long getAnalysisDate() {
66 return delegate.getAnalysisDate();
70 public boolean hasAnalysisDateBeenSet() {
71 return delegate.hasAnalysisDateBeenSet();
75 public boolean isFirstAnalysis() {
76 return delegate.isFirstAnalysis();
80 public MutableAnalysisMetadataHolderRule setBaseAnalysis(@Nullable Analysis baseAnalysis) {
81 delegate.setBaseAnalysis(baseAnalysis);
87 public Analysis getBaseAnalysis() {
88 return delegate.getBaseAnalysis();
92 public boolean isCrossProjectDuplicationEnabled() {
93 return delegate.isCrossProjectDuplicationEnabled();
97 public MutableAnalysisMetadataHolderRule setCrossProjectDuplicationEnabled(boolean isCrossProjectDuplicationEnabled) {
98 delegate.setCrossProjectDuplicationEnabled(isCrossProjectDuplicationEnabled);
103 public Optional<Branch> getBranch() {
104 return delegate.getBranch();
108 public MutableAnalysisMetadataHolderRule setBranch(Branch branch) {
109 delegate.setBranch(branch);
114 public MutableAnalysisMetadataHolderRule setProject(@Nullable Project project) {
115 delegate.setProject(project);
120 public Project getProject() {
121 return delegate.getProject();
125 public MutableAnalysisMetadataHolderRule setRootComponentRef(int rootComponentRef) {
126 delegate.setRootComponentRef(rootComponentRef);
131 public int getRootComponentRef() {
132 return delegate.getRootComponentRef();
136 public MutableAnalysisMetadataHolder setQProfilesByLanguage(Map<String, QualityProfile> qprofilesByLanguage) {
137 delegate.setQProfilesByLanguage(qprofilesByLanguage);
142 public Map<String, QualityProfile> getQProfilesByLanguage() {
143 return delegate.getQProfilesByLanguage();
147 public MutableAnalysisMetadataHolder setScannerPluginsByKey(Map<String, ScannerPlugin> plugins) {
148 delegate.setScannerPluginsByKey(plugins);
153 public Map<String, ScannerPlugin> getScannerPluginsByKey() {
154 return delegate.getScannerPluginsByKey();
158 public boolean isIncrementalAnalysis() {
159 return delegate.isIncrementalAnalysis();
163 public MutableAnalysisMetadataHolder setIncrementalAnalysis(boolean isIncrementalAnalysis) {
164 delegate.setIncrementalAnalysis(isIncrementalAnalysis);
169 public boolean isShortLivingBranch() {
170 return delegate.isShortLivingBranch();