You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProxyConnectorRule.java 3.6KB

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