1 package org.apache.archiva.configuration;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 /**
23 * The FileType object.
24 *
25 * @version $Revision$ $Date$
26 */
27 @SuppressWarnings( "all" )
28 public class FileType
29 implements java.io.Serializable
30 {
31
32 //--------------------------/
33 //- Class/Member Variables -/
34 //--------------------------/
35
36 /**
37 * Field id.
38 */
39 private String id;
40
41 /**
42 * Field patterns.
43 */
44 private java.util.List<String> patterns;
45
46
47 //-----------/
48 //- Methods -/
49 //-----------/
50
51 /**
52 * Method addPattern.
53 *
54 * @param string
55 */
56 public void addPattern( String string )
57 {
58 getPatterns().add( string );
59 } //-- void addPattern( String )
60
61 /**
62 * Get the id field.
63 *
64 * @return String
65 */
66 public String getId()
67 {
68 return this.id;
69 } //-- String getId()
70
71 /**
72 * Method getPatterns.
73 *
74 * @return List
75 */
76 public java.util.List<String> getPatterns()
77 {
78 if ( this.patterns == null )
79 {
80 this.patterns = new java.util.ArrayList<String>();
81 }
82
83 return this.patterns;
84 } //-- java.util.List<String> getPatterns()
85
86 /**
87 * Method removePattern.
88 *
89 * @param string
90 */
91 public void removePattern( String string )
92 {
93 getPatterns().remove( string );
94 } //-- void removePattern( String )
95
96 /**
97 * Set the id field.
98 *
99 * @param id
100 */
101 public void setId( String id )
102 {
103 this.id = id;
104 } //-- void setId( String )
105
106 /**
107 * Set the patterns field.
108 *
109 * @param patterns
110 */
111 public void setPatterns( java.util.List<String> patterns )
112 {
113 this.patterns = patterns;
114 } //-- void setPatterns( java.util.List )
115
116
117
118 @Override
119 public boolean equals( Object o )
120 {
121 if ( this == o )
122 {
123 return true;
124 }
125 if ( o == null || getClass() != o.getClass() )
126 {
127 return false;
128 }
129
130 FileType./../../org/apache/archiva/configuration/FileType.html#FileType">FileType fileType = (FileType) o;
131
132 if ( id != null ? !id.equals( fileType.id ) : fileType.id != null )
133 {
134 return false;
135 }
136
137 return true;
138 }
139
140 @Override
141 public int hashCode()
142 {
143 return id != null ? 37 + id.hashCode() : 0;
144 }
145
146 }