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