1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.settings.crypto;
20
21 import java.util.ArrayList;
22 import java.util.Arrays;
23 import java.util.List;
24
25 import org.apache.maven.settings.Proxy;
26 import org.apache.maven.settings.Server;
27 import org.apache.maven.settings.Settings;
28
29
30
31
32
33
34 public class DefaultSettingsDecryptionRequest implements SettingsDecryptionRequest {
35
36 private List<Server> servers;
37
38 private List<Proxy> proxies;
39
40
41
42
43 public DefaultSettingsDecryptionRequest() {
44
45 }
46
47
48
49
50
51
52 public DefaultSettingsDecryptionRequest(Settings settings) {
53 setServers(settings.getServers());
54 setProxies(settings.getProxies());
55 }
56
57
58
59
60
61
62 public DefaultSettingsDecryptionRequest(Server server) {
63 this.servers = new ArrayList<>(Arrays.asList(server));
64 }
65
66
67
68
69
70
71 public DefaultSettingsDecryptionRequest(Proxy proxy) {
72 this.proxies = new ArrayList<>(Arrays.asList(proxy));
73 }
74
75 @Override
76 public List<Server> getServers() {
77 if (servers == null) {
78 servers = new ArrayList<>();
79 }
80
81 return servers;
82 }
83
84 @Override
85 public DefaultSettingsDecryptionRequest setServers(List<Server> servers) {
86 this.servers = servers;
87
88 return this;
89 }
90
91 @Override
92 public List<Proxy> getProxies() {
93 if (proxies == null) {
94 proxies = new ArrayList<>();
95 }
96
97 return proxies;
98 }
99
100 @Override
101 public DefaultSettingsDecryptionRequest setProxies(List<Proxy> proxies) {
102 this.proxies = proxies;
103
104 return this;
105 }
106 }