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.ArrayList;
20 import java.util.List;
21 import java.util.stream.Collectors;
22
23 import com.linecorp.centraldogma.internal.thrift.PluginOperation;
24
25 public class PluginOperationDto {
26 private String pluginName;
27 private String operationName;
28 private List<PluginOperationParamDefDto> paramDefs = new ArrayList<>();
29 private PluginOperationReturnDefDto returnDef;
30 private CommentDto comment;
31
32 public PluginOperationDto() {}
33
34 public PluginOperationDto(PluginOperation pluginOperation) {
35 pluginName = pluginOperation.getPluginName();
36 operationName = pluginOperation.getOperationName();
37 paramDefs = pluginOperation.getParamDefs().stream()
38 .map(PluginOperationParamDefDto::new).collect(Collectors.toList());
39 returnDef = new PluginOperationReturnDefDto(pluginOperation.getReturnDef());
40 if (pluginOperation.getComment() != null) {
41 comment = new CommentDto(pluginOperation.getComment());
42 }
43 }
44
45 public String getPluginName() {
46 return pluginName;
47 }
48
49 public void setPluginName(String pluginName) {
50 this.pluginName = pluginName;
51 }
52
53 public String getOperationName() {
54 return operationName;
55 }
56
57 public void setOperationName(String operationName) {
58 this.operationName = operationName;
59 }
60
61 public List<PluginOperationParamDefDto> getParamDefs() {
62 return paramDefs;
63 }
64
65 public void setParamDefs(List<PluginOperationParamDefDto> paramDefs) {
66 this.paramDefs = paramDefs;
67 }
68
69 public PluginOperationReturnDefDto getReturnDef() {
70 return returnDef;
71 }
72
73 public void setReturnDef(PluginOperationReturnDefDto returnDef) {
74 this.returnDef = returnDef;
75 }
76
77 public CommentDto getComment() {
78 return comment;
79 }
80
81 public void setComment(CommentDto comment) {
82 this.comment = comment;
83 }
84 }