3 * Copyright (C) 2009-2016 SonarSource SA
4 * mailto:contact 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 javax.annotation.CheckForNull;
24 import javax.annotation.Nullable;
25 import org.junit.rules.ExternalResource;
26 import org.sonar.server.computation.task.projectanalysis.qualityprofile.QualityProfile;
28 public class MutableAnalysisMetadataHolderRule extends ExternalResource implements MutableAnalysisMetadataHolder {
30 private AnalysisMetadataHolderImpl delegate = new AnalysisMetadataHolderImpl();
33 protected void after() {
34 delegate = new AnalysisMetadataHolderImpl();
38 public String getUuid() {
39 return delegate.getUuid();
42 public MutableAnalysisMetadataHolderRule setUuid(String s) {
48 public long getAnalysisDate() {
49 return delegate.getAnalysisDate();
52 public MutableAnalysisMetadataHolderRule setAnalysisDate(long date) {
53 delegate.setAnalysisDate(date);
58 public boolean isFirstAnalysis() {
59 return delegate.isFirstAnalysis();
63 public MutableAnalysisMetadataHolderRule setBaseAnalysis(@Nullable Analysis baseAnalysis) {
64 delegate.setBaseAnalysis(baseAnalysis);
70 public Analysis getBaseAnalysis() {
71 return delegate.getBaseAnalysis();
75 public boolean isCrossProjectDuplicationEnabled() {
76 return delegate.isCrossProjectDuplicationEnabled();
80 public MutableAnalysisMetadataHolderRule setCrossProjectDuplicationEnabled(boolean isCrossProjectDuplicationEnabled) {
81 delegate.setCrossProjectDuplicationEnabled(isCrossProjectDuplicationEnabled);
86 public String getBranch() {
87 return delegate.getBranch();
91 public MutableAnalysisMetadataHolderRule setBranch(@Nullable String branch) {
92 delegate.setBranch(branch);
97 public MutableAnalysisMetadataHolderRule setRootComponentRef(int rootComponentRef) {
98 delegate.setRootComponentRef(rootComponentRef);
103 public int getRootComponentRef() {
104 return delegate.getRootComponentRef();
108 public MutableAnalysisMetadataHolder setQProfilesByLanguage(Map<String, QualityProfile> qprofilesByLanguage) {
109 delegate.setQProfilesByLanguage(qprofilesByLanguage);
114 public Map<String, QualityProfile> getQProfilesByLanguage() {
115 return delegate.getQProfilesByLanguage();