Skip to content

Commit 40117c3

Browse files
authored
Merge pull request #367 from DependencyTrack/port-pr2581
Added transient List of ProjectVersions and set Metrics in Project
2 parents 98ba9a8 + 67285e0 commit 40117c3

File tree

6 files changed

+180
-20
lines changed

6 files changed

+180
-20
lines changed

src/main/java/org/dependencytrack/model/Project.java

+10
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ public enum FetchGroup {
277277

278278
private transient ProjectMetrics metrics;
279279

280+
private transient List<ProjectVersion> versions;
281+
280282
private transient List<Component> dependencyGraph;
281283

282284
public long getId() {
@@ -476,6 +478,14 @@ public void setMetrics(ProjectMetrics metrics) {
476478
this.metrics = metrics;
477479
}
478480

481+
public List<ProjectVersion> getVersions() {
482+
return versions;
483+
}
484+
485+
public void setVersions(List<ProjectVersion> versions) {
486+
this.versions = versions;
487+
}
488+
479489
public List<Team> getAccessTeams() {
480490
return accessTeams;
481491
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* This file is part of Dependency-Track.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
* SPDX-License-Identifier: Apache-2.0
17+
* Copyright (c) Steve Springett. All Rights Reserved.
18+
*/
19+
package org.dependencytrack.model;
20+
21+
import com.fasterxml.jackson.annotation.JsonInclude;
22+
23+
import java.io.Serializable;
24+
import java.util.UUID;
25+
26+
/**
27+
* Value object holding UUID and version for a project
28+
*/
29+
@JsonInclude(JsonInclude.Include.NON_NULL)
30+
public class ProjectVersion implements Serializable {
31+
32+
private static final long serialVersionUID = 1L;
33+
34+
private UUID uuid;
35+
36+
private String version;
37+
38+
public ProjectVersion() {
39+
this.uuid = null;
40+
this.version = null;
41+
}
42+
43+
public ProjectVersion(UUID uuid, String version) {
44+
this.uuid = uuid;
45+
this.version = version;
46+
47+
}
48+
49+
public void setUuid(UUID uuid) {
50+
this.uuid = uuid;
51+
}
52+
53+
public UUID getUuid() {
54+
return uuid;
55+
}
56+
57+
public void setVersion(String version) {
58+
this.version = version;
59+
}
60+
61+
public String getVersion() {
62+
return version;
63+
}
64+
}

0 commit comments

Comments
 (0)