This project has retired. For details please refer to its Attic page.
ProxyConnectorRule xref
View Javadoc
1   package org.apache.archiva.admin.model.beans;
2   /*
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   */
20  
21  import javax.xml.bind.annotation.XmlRootElement;
22  import java.io.Serializable;
23  import java.util.ArrayList;
24  import java.util.List;
25  
26  /**
27   * @author Olivier Lamy
28   * @since 1.4-M3
29   */
30  @XmlRootElement ( name = "proxyConnectorRule" )
31  public class ProxyConnectorRule
32      implements Serializable
33  {
34      private String pattern;
35  
36      //FIXME: olamy possible tru rest ? or a String
37      private ProxyConnectorRuleType proxyConnectorRuleType;
38  
39      private List<ProxyConnector> proxyConnectors;
40  
41      public ProxyConnectorRule()
42      {
43          // no op
44      }
45  
46      public ProxyConnectorRule( String pattern, ProxyConnectorRuleType proxyConnectorRuleType,
47                                 List<ProxyConnector> proxyConnectors )
48      {
49          this.pattern = pattern;
50          this.proxyConnectorRuleType = proxyConnectorRuleType;
51          this.proxyConnectors = proxyConnectors;
52      }
53  
54      public String getPattern()
55      {
56          return pattern;
57      }
58  
59      public void setPattern( String pattern )
60      {
61          this.pattern = pattern;
62      }
63  
64      public ProxyConnectorRuleType getProxyConnectorRuleType()
65      {
66          return proxyConnectorRuleType;
67      }
68  
69      public void setProxyConnectorRuleType( ProxyConnectorRuleType proxyConnectorRuleType )
70      {
71          this.proxyConnectorRuleType = proxyConnectorRuleType;
72      }
73  
74      public List<ProxyConnector> getProxyConnectors()
75      {
76          if ( this.proxyConnectors == null )
77          {
78              this.proxyConnectors = new ArrayList<>();
79          }
80          return proxyConnectors;
81      }
82  
83      public void setProxyConnectors( List<ProxyConnector> proxyConnectors )
84      {
85          this.proxyConnectors = proxyConnectors;
86      }
87  
88      @Override
89      public boolean equals( Object o )
90      {
91          if ( this == o )
92          {
93              return true;
94          }
95          if ( !( o instanceof ProxyConnectorRule ) )
96          {
97              return false;
98          }
99  
100         ProxyConnectorRule that = (ProxyConnectorRule) o;
101 
102         if ( !pattern.equals( that.pattern ) )
103         {
104             return false;
105         }
106         if ( proxyConnectorRuleType != that.proxyConnectorRuleType )
107         {
108             return false;
109         }
110 
111         return true;
112     }
113 
114     @Override
115     public int hashCode()
116     {
117         int result = pattern.hashCode();
118         result = 31 * result + proxyConnectorRuleType.hashCode();
119         return result;
120     }
121 
122     @Override
123     public String toString()
124     {
125         final StringBuilder sb = new StringBuilder();
126         sb.append( "ProxyConnectorRule" );
127         sb.append( "{pattern='" ).append( pattern ).append( '\'' );
128         sb.append( ", proxyConnectorRuleType=" ).append( proxyConnectorRuleType );
129         sb.append( ", proxyConnectors=" ).append( proxyConnectors );
130         sb.append( '}' );
131         return sb.toString();
132     }
133 }