1
2
3
4
5 package org.apache.maven.settings;
6
7 import java.io.Serializable;
8 import java.util.AbstractList;
9 import java.util.Collections;
10 import java.util.HashMap;
11 import java.util.LinkedHashMap;
12 import java.util.List;
13 import java.util.Map;
14 import java.util.Objects;
15 import java.util.Set;
16 import java.util.stream.Collectors;
17 import java.util.stream.Stream;
18 import org.apache.maven.api.annotations.Generated;
19 import org.apache.maven.api.annotations.Nonnull;
20
21 @Generated
22 public class Proxy
23 extends IdentifiableBase
24 implements Serializable, Cloneable
25 {
26
27 public Proxy() {
28 this(org.apache.maven.api.settings.Proxy.newInstance());
29 }
30
31 public Proxy(org.apache.maven.api.settings.Proxy delegate) {
32 this(delegate, null);
33 }
34
35 public Proxy(org.apache.maven.api.settings.Proxy delegate, BaseObject parent) {
36 super(delegate, parent);
37 }
38
39 public Proxy clone(){
40 return new Proxy(getDelegate());
41 }
42
43 @Override
44 public org.apache.maven.api.settings.Proxy getDelegate() {
45 return (org.apache.maven.api.settings.Proxy) super.getDelegate();
46 }
47
48 @Override
49 public boolean equals(Object o) {
50 if (this == o) {
51 return true;
52 }
53 if (o == null || !(o instanceof Proxy)) {
54 return false;
55 }
56 Proxy that = (Proxy) o;
57 return Objects.equals(this.delegate, that.delegate);
58 }
59
60 @Override
61 public int hashCode() {
62 return getDelegate().hashCode();
63 }
64
65 public String getActiveString() {
66 return getDelegate().getActiveString();
67 }
68
69 public void setActiveString(String activeString) {
70 if (!Objects.equals(activeString, getActiveString())) {
71 update(getDelegate().withActiveString(activeString));
72 }
73 }
74
75 public String getProtocol() {
76 return getDelegate().getProtocol();
77 }
78
79 public void setProtocol(String protocol) {
80 if (!Objects.equals(protocol, getProtocol())) {
81 update(getDelegate().withProtocol(protocol));
82 }
83 }
84
85 public String getUsername() {
86 return getDelegate().getUsername();
87 }
88
89 public void setUsername(String username) {
90 if (!Objects.equals(username, getUsername())) {
91 update(getDelegate().withUsername(username));
92 }
93 }
94
95 public String getPassword() {
96 return getDelegate().getPassword();
97 }
98
99 public void setPassword(String password) {
100 if (!Objects.equals(password, getPassword())) {
101 update(getDelegate().withPassword(password));
102 }
103 }
104
105 public String getPortString() {
106 return getDelegate().getPortString();
107 }
108
109 public void setPortString(String portString) {
110 if (!Objects.equals(portString, getPortString())) {
111 update(getDelegate().withPortString(portString));
112 }
113 }
114
115 public String getHost() {
116 return getDelegate().getHost();
117 }
118
119 public void setHost(String host) {
120 if (!Objects.equals(host, getHost())) {
121 update(getDelegate().withHost(host));
122 }
123 }
124
125 public String getNonProxyHosts() {
126 return getDelegate().getNonProxyHosts();
127 }
128
129 public void setNonProxyHosts(String nonProxyHosts) {
130 if (!Objects.equals(nonProxyHosts, getNonProxyHosts())) {
131 update(getDelegate().withNonProxyHosts(nonProxyHosts));
132 }
133 }
134
135 protected boolean replace(Object oldDelegate, Object newDelegate) {
136 if (super.replace(oldDelegate, newDelegate)) {
137 return true;
138 }
139 return false;
140 }
141
142 public static List<org.apache.maven.api.settings.Proxy> proxyToApiV4(List<Proxy> list) {
143 return list != null ? new WrapperList<>(list, Proxy::getDelegate, Proxy::new) : null;
144 }
145
146 public static List<Proxy> proxyToApiV3(List<org.apache.maven.api.settings.Proxy> list) {
147 return list != null ? new WrapperList<>(list, Proxy::new, Proxy::getDelegate) : null;
148 }
149
150
151 public boolean isActive() {
152 return (getActiveString() != null) ? Boolean.parseBoolean(getActiveString()) : true;
153 }
154
155 public void setActive(boolean active) {
156 setActiveString(String.valueOf(active));
157 }
158
159 public int getPort() {
160 return (getPortString() != null) ? Integer.parseInt(getPortString()) : 8080;
161 }
162
163 public void setPort(int port) {
164 setPortString(String.valueOf(port));
165 }
166
167 }