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 org.apache.archiva.proxy.model.ProxyConnectorRuleType;
22  
23  import javax.xml.bind.annotation.XmlRootElement;
24  import java.io.Serializable;
25  import java.util.ArrayList;
26  import java.util.List;
27  
28  /**
29   * @author Olivier Lamy
30   * @since 1.4-M3
31   */
32  @XmlRootElement ( name = "proxyConnectorRule" )
33  public class ProxyConnectorRule
34      implements Serializable
35  {
36      private String pattern;
37  
38      //FIXME: olamy possible tru rest ? or a String
39      private ProxyConnectorRuleType proxyConnectorRuleType;
40  
41      private List<ProxyConnector> proxyConnectors;
42  
43      public ProxyConnectorRule()
44      {
45          // no op
46      }
47  
48      public ProxyConnectorRule( String pattern, ProxyConnectorRuleType proxyConnectorRuleType,
49                                 List<ProxyConnector> proxyConnectors )
50      {
51          this.pattern = pattern;
52          this.proxyConnectorRuleType = proxyConnectorRuleType;
53          this.proxyConnectors = proxyConnectors;
54      }
55  
56      public String getPattern()
57      {
58          return pattern;
59      }
60  
61      public void setPattern( String pattern )
62      {
63          this.pattern = pattern;
64      }
65  
66      public ProxyConnectorRuleType getProxyConnectorRuleType()
67      {
68          return proxyConnectorRuleType;
69      }
70  
71      public void setProxyConnectorRuleType( ProxyConnectorRuleType proxyConnectorRuleType )
72      {
73          this.proxyConnectorRuleType = proxyConnectorRuleType;
74      }
75  
76      public List<ProxyConnector> getProxyConnectors()
77      {
78          if ( this.proxyConnectors == null )
79          {
80              this.proxyConnectors = new ArrayList<>();
81          }
82          return proxyConnectors;
83      }
84  
85      public void setProxyConnectors( List<ProxyConnector> proxyConnectors )
86      {
87          this.proxyConnectors = proxyConnectors;
88      }
89  
90      @Override
91      public boolean equals( Object o )
92      {
93          if ( this == o )
94          {
95              return true;
96          }
97          if ( !( o instanceof ProxyConnectorRule ) )
98          {
99              return false;
100         }
101 
102         ProxyConnectorRule./../../org/apache/archiva/admin/model/beans/ProxyConnectorRule.html#ProxyConnectorRule">ProxyConnectorRule that = (ProxyConnectorRule) o;
103 
104         if ( !pattern.equals( that.pattern ) )
105         {
106             return false;
107         }
108         if ( proxyConnectorRuleType != that.proxyConnectorRuleType )
109         {
110             return false;
111         }
112 
113         return true;
114     }
115 
116     @Override
117     public int hashCode()
118     {
119         int result = pattern.hashCode();
120         result = 31 * result + proxyConnectorRuleType.hashCode();
121         return result;
122     }
123 
124     @Override
125     public String toString()
126     {
127         final StringBuilder sb = new StringBuilder();
128         sb.append( "ProxyConnectorRule" );
129         sb.append( "{pattern='" ).append( pattern ).append( '\'' );
130         sb.append( ", proxyConnectorRuleType=" ).append( proxyConnectorRuleType );
131         sb.append( ", proxyConnectors=" ).append( proxyConnectors );
132         sb.append( '}' );
133         return sb.toString();
134     }
135 }