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.util.List;
20 import java.util.stream.Collectors;
21
22 import com.linecorp.centraldogma.internal.thrift.SchemaEntry;
23
24 public class SchemaEntryDto {
25 private String repositoryName;
26 private String path;
27 private PropertyFilterDto propertyFilter;
28 private List<String> types;
29 private CommentDto comment;
30
31 public SchemaEntryDto() {}
32
33 public SchemaEntryDto(SchemaEntry schemaEntry) {
34 repositoryName = schemaEntry.getRepositoryName();
35 path = schemaEntry.getPath();
36 propertyFilter = new PropertyFilterDto(schemaEntry.getPropertyFilter());
37 types = schemaEntry.getTypes().stream().map(Enum::name).collect(Collectors.toList());
38 if (schemaEntry.getComment() != null) {
39 comment = new CommentDto(schemaEntry.getComment());
40 }
41 }
42
43 public String getRepositoryName() {
44 return repositoryName;
45 }
46
47 public void setRepositoryName(String repositoryName) {
48 this.repositoryName = repositoryName;
49 }
50
51 public String getPath() {
52 return path;
53 }
54
55 public void setPath(String path) {
56 this.path = path;
57 }
58
59 public PropertyFilterDto getPropertyFilter() {
60 return propertyFilter;
61 }
62
63 public void setPropertyFilter(PropertyFilterDto propertyFilter) {
64 this.propertyFilter = propertyFilter;
65 }
66
67 public List<String> getTypes() {
68 return types;
69 }
70
71 public void setTypes(List<String> types) {
72 this.types = types;
73 }
74
75 public CommentDto getComment() {
76 return comment;
77 }
78
79 public void setComment(CommentDto comment) {
80 this.comment = comment;
81 }
82 }