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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. package org.apache.archiva.configuration.model;
  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. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. /**
  20. * The FileType object.
  21. *
  22. * @version $Revision$ $Date$
  23. */
  24. @SuppressWarnings( "all" )
  25. public class FileType
  26. implements java.io.Serializable
  27. {
  28. //--------------------------/
  29. //- Class/Member Variables -/
  30. //--------------------------/
  31. /**
  32. * Field id.
  33. */
  34. private String id;
  35. /**
  36. * Field patterns.
  37. */
  38. private java.util.List<String> patterns;
  39. //-----------/
  40. //- Methods -/
  41. //-----------/
  42. /**
  43. * Method addPattern.
  44. *
  45. * @param string
  46. */
  47. public void addPattern( String string )
  48. {
  49. getPatterns().add( string );
  50. } //-- void addPattern( String )
  51. /**
  52. * Get the id field.
  53. *
  54. * @return String
  55. */
  56. public String getId()
  57. {
  58. return this.id;
  59. } //-- String getId()
  60. /**
  61. * Method getPatterns.
  62. *
  63. * @return List
  64. */
  65. public java.util.List<String> getPatterns()
  66. {
  67. if ( this.patterns == null )
  68. {
  69. this.patterns = new java.util.ArrayList<String>();
  70. }
  71. return this.patterns;
  72. } //-- java.util.List<String> getPatterns()
  73. /**
  74. * Method removePattern.
  75. *
  76. * @param string
  77. */
  78. public void removePattern( String string )
  79. {
  80. getPatterns().remove( string );
  81. } //-- void removePattern( String )
  82. /**
  83. * Set the id field.
  84. *
  85. * @param id
  86. */
  87. public void setId( String id )
  88. {
  89. this.id = id;
  90. } //-- void setId( String )
  91. /**
  92. * Set the patterns field.
  93. *
  94. * @param patterns
  95. */
  96. public void setPatterns( java.util.List<String> patterns )
  97. {
  98. this.patterns = patterns;
  99. } //-- void setPatterns( java.util.List )
  100. @Override
  101. public boolean equals( Object o )
  102. {
  103. if ( this == o )
  104. {
  105. return true;
  106. }
  107. if ( o == null || getClass() != o.getClass() )
  108. {
  109. return false;
  110. }
  111. FileType fileType = (FileType) o;
  112. if ( id != null ? !id.equals( fileType.id ) : fileType.id != null )
  113. {
  114. return false;
  115. }
  116. return true;
  117. }
  118. @Override
  119. public int hashCode()
  120. {
  121. return id != null ? 37 + id.hashCode() : 0;
  122. }
  123. }