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.component;
22 import javax.annotation.CheckForNull;
23 import javax.annotation.Nullable;
24 import javax.annotation.concurrent.Immutable;
27 * Component properties which are specific to the Batch Report.
30 public class ReportAttributes {
31 private final int ref;
33 private final String version;
35 private final String path;
37 private ReportAttributes(Builder builder) {
38 this.ref = builder.ref;
39 this.version = builder.version;
40 this.path = builder.path;
43 public static Builder newBuilder(int ref) {
44 return new Builder(ref);
47 public static class Builder {
48 private final int ref;
50 private String version;
54 private Builder(int ref) {
58 public Builder setVersion(@Nullable String version) {
59 this.version = version;
63 public Builder setPath(@Nullable String path) {
68 public ReportAttributes build() {
69 return new ReportAttributes(this);
74 * The component ref in the batch report.
81 * The project or module version as defined in the batch report.
84 public String getVersion() {
89 * The path of the report component, must be non null for module, directories and files.
92 public String getPath() {
97 public String toString() {
98 return "ReportAttributes{" +
100 ", version='" + version + '\'' +
101 ", path='" + path + '\'' +