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