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 public class DefaultSettingsDecryptionRequest implements SettingsDecryptionRequest {
34
35 private List<Server> servers;
36
37 private List<Proxy> proxies;
38
39
40
41
42 public DefaultSettingsDecryptionRequest() {
43
44 }
45
46
47
48
49
50
51 public DefaultSettingsDecryptionRequest(Settings settings) {
52 setServers(settings.getServers());
53 setProxies(settings.getProxies());
54 }
55
56
57
58
59
60
61 public DefaultSettingsDecryptionRequest(Server server) {
62 this.servers = new ArrayList<>(Arrays.asList(server));
63 }
64
65
66
67
68
69
70 public DefaultSettingsDecryptionRequest(Proxy proxy) {
71 this.proxies = new ArrayList<>(Arrays.asList(proxy));
72 }
73
74 @Override
75 public List<Server> getServers() {
76 if (servers == null) {
77 servers = new ArrayList<>();
78 }
79
80 return servers;
81 }
82
83 @Override
84 public DefaultSettingsDecryptionRequest setServers(List<Server> servers) {
85 this.servers = servers;
86
87 return this;
88 }
89
90 @Override
91 public List<Proxy> getProxies() {
92 if (proxies == null) {
93 proxies = new ArrayList<>();
94 }
95
96 return proxies;
97 }
98
99 @Override
100 public DefaultSettingsDecryptionRequest setProxies(List<Proxy> proxies) {
101 this.proxies = proxies;
102
103 return this;
104 }
105 }