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.

FileType.java 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. package org.apache.archiva.configuration;
  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. * The FileType object.
  22. *
  23. * @version $Revision$ $Date$
  24. */
  25. @SuppressWarnings( "all" )
  26. public class FileType
  27. implements java.io.Serializable
  28. {
  29. //--------------------------/
  30. //- Class/Member Variables -/
  31. //--------------------------/
  32. /**
  33. * Field id.
  34. */
  35. private String id;
  36. /**
  37. * Field patterns.
  38. */
  39. private java.util.List<String> patterns;
  40. //-----------/
  41. //- Methods -/
  42. //-----------/
  43. /**
  44. * Method addPattern.
  45. *
  46. * @param string
  47. */
  48. public void addPattern( String string )
  49. {
  50. getPatterns().add( string );
  51. } //-- void addPattern( String )
  52. /**
  53. * Get the id field.
  54. *
  55. * @return String
  56. */
  57. public String getId()
  58. {
  59. return this.id;
  60. } //-- String getId()
  61. /**
  62. * Method getPatterns.
  63. *
  64. * @return List
  65. */
  66. public java.util.List<String> getPatterns()
  67. {
  68. if ( this.patterns == null )
  69. {
  70. this.patterns = new java.util.ArrayList<String>();
  71. }
  72. return this.patterns;
  73. } //-- java.util.List<String> getPatterns()
  74. /**
  75. * Method removePattern.
  76. *
  77. * @param string
  78. */
  79. public void removePattern( String string )
  80. {
  81. getPatterns().remove( string );
  82. } //-- void removePattern( String )
  83. /**
  84. * Set the id field.
  85. *
  86. * @param id
  87. */
  88. public void setId( String id )
  89. {
  90. this.id = id;
  91. } //-- void setId( String )
  92. /**
  93. * Set the patterns field.
  94. *
  95. * @param patterns
  96. */
  97. public void setPatterns( java.util.List<String> patterns )
  98. {
  99. this.patterns = patterns;
  100. } //-- void setPatterns( java.util.List )
  101. @Override
  102. public boolean equals( Object o )
  103. {
  104. if ( this == o )
  105. {
  106. return true;
  107. }
  108. if ( o == null || getClass() != o.getClass() )
  109. {
  110. return false;
  111. }
  112. FileType fileType = (FileType) o;
  113. if ( id != null ? !id.equals( fileType.id ) : fileType.id != null )
  114. {
  115. return false;
  116. }
  117. return true;
  118. }
  119. @Override
  120. public int hashCode()
  121. {
  122. return id != null ? 37 + id.hashCode() : 0;
  123. }
  124. }