1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.linecorp.centraldogma.server.internal.admin.dto;
18
19 import java.io.Serializable;
20 import java.util.ArrayList;
21 import java.util.List;
22 import java.util.stream.Collectors;
23
24 import com.linecorp.centraldogma.internal.thrift.Project;
25
26 public class ProjectDto implements Serializable {
27
28 private static final long serialVersionUID = -537677643104565582L;
29
30 private String name;
31 private SchemaDto schema;
32 private List<PluginDto> plugins = new ArrayList<>();
33
34 public ProjectDto() {}
35
36 public ProjectDto(Project project) {
37 name = project.getName();
38 if (project.getSchema() != null) {
39 schema = new SchemaDto(project.getSchema());
40 }
41 if (project.getPlugins() != null) {
42 plugins = project.getPlugins().stream().map(PluginDto::new).collect(Collectors.toList());
43 }
44 }
45
46 public String getName() {
47 return name;
48 }
49
50 public void setName(String name) {
51 this.name = name;
52 }
53
54 public SchemaDto getSchema() {
55 return schema;
56 }
57
58 public void setSchema(SchemaDto schema) {
59 this.schema = schema;
60 }
61
62 public List<PluginDto> getPlugins() {
63 return plugins;
64 }
65
66 public void setPlugins(List<PluginDto> plugins) {
67 this.plugins = plugins;
68 }
69 }