blob: eae4c0b1ca11dd2220ccfec18a6ce3cc6a7c2882 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
/*
* SonarQube
* Copyright (C) 2009-2025 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.db.project;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.sonar.db.entity.EntityDto;
import static org.apache.commons.lang3.StringUtils.trimToNull;
import static org.sonar.db.component.DbTagsReader.readDbTags;
public class ProjectDto extends EntityDto {
private static final String TAGS_SEPARATOR = ",";
private String tags;
private CreationMethod creationMethod;
private boolean containsAiCode;
private boolean aiCodeFixEnabled = false;
private boolean detectedAiCode;
private long createdAt;
private long updatedAt;
public long getCreatedAt() {
return createdAt;
}
public ProjectDto setCreatedAt(long createdAt) {
this.createdAt = createdAt;
return this;
}
public long getUpdatedAt() {
return updatedAt;
}
public ProjectDto setUpdatedAt(long updatedAt) {
this.updatedAt = updatedAt;
return this;
}
public ProjectDto setUuid(String uuid) {
this.uuid = uuid;
return this;
}
/**
* This is the setter used by MyBatis mapper.
*/
public ProjectDto setKee(String kee) {
this.kee = kee;
return this;
}
public ProjectDto setKey(String key) {
return setKee(key);
}
@Override
public ProjectDto setPrivate(boolean aPrivate) {
isPrivate = aPrivate;
return this;
}
public List<String> getTags() {
return readDbTags(tags);
}
public ProjectDto setTags(List<String> tags) {
setTagsString(tags.stream()
.filter(t -> !t.isEmpty())
.collect(Collectors.joining(TAGS_SEPARATOR)));
return this;
}
/**
* Used by MyBatis
*/
@CheckForNull
public String getTagsString() {
return tags;
}
public ProjectDto setTagsString(@Nullable String tags) {
this.tags = trimToNull(tags);
return this;
}
public ProjectDto setName(String name) {
this.name = name;
return this;
}
public ProjectDto setDescription(@Nullable String description) {
this.description = description;
return this;
}
public ProjectDto setQualifier(String qualifier) {
this.qualifier = qualifier;
return this;
}
public CreationMethod getCreationMethod() {
return creationMethod;
}
public ProjectDto setCreationMethod(CreationMethod creationMethod) {
this.creationMethod = creationMethod;
return this;
}
public boolean getContainsAiCode() {
return containsAiCode;
}
public ProjectDto setContainsAiCode(boolean containsAiCode) {
this.containsAiCode = containsAiCode;
return this;
}
public boolean getDetectedAiCode() {
return detectedAiCode;
}
public ProjectDto setDetectedAiCode(boolean detectedAiCode) {
this.detectedAiCode = detectedAiCode;
return this;
}
public boolean getAiCodeFixEnabled() {
return aiCodeFixEnabled;
}
public ProjectDto setAiCodeFixEnabled(boolean aiCodeFixEnabled) {
this.aiCodeFixEnabled = aiCodeFixEnabled;
return this;
}
}
|