1 package org.apache.maven.archiva.indexer.record;
6 * Copyright 2005-2006 The Apache Software Foundation.
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 * The a record with the fields in the standard index.
24 * @author <a href="mailto:brett@apache.org">Brett Porter</a>
26 public class StandardArtifactIndexRecord
27 extends MinimalArtifactIndexRecord
30 * The SHA-1 checksum of the artifact file.
32 private String sha1Checksum;
35 * The artifact's group.
37 private String groupId;
40 * The artifact's identifier within the group.
42 private String artifactId;
45 * The artifact's version.
47 private String version;
50 * The classifier, if there is one.
52 private String classifier;
55 * The artifact type (from the file).
60 * A list of files (separated by '\n') in the artifact if it is an archive.
65 * The identifier of the repository that the artifact came from.
67 private String repository;
70 * The packaging specified in the POM for this artifact.
72 private String packaging;
75 * The plugin prefix specified in the metadata if the artifact is a plugin.
77 private String pluginPrefix;
80 * The year the project was started.
82 private String inceptionYear;
85 * The description of the project.
87 private String projectDescription;
90 * The name of the project.
92 private String projectName;
95 * The base version (before the snapshot is determined).
97 private String baseVersion;
99 public void setSha1Checksum( String sha1Checksum )
101 this.sha1Checksum = sha1Checksum;
104 public void setGroupId( String groupId )
106 this.groupId = groupId;
109 public void setArtifactId( String artifactId )
111 this.artifactId = artifactId;
114 public void setVersion( String version )
116 this.version = version;
119 public void setClassifier( String classifier )
121 this.classifier = classifier;
124 public void setType( String type )
129 public void setFiles( List files )
134 public void setRepository( String repository )
136 this.repository = repository;
140 * @noinspection RedundantIfStatement
142 public boolean equals( Object obj )
148 if ( obj == null || getClass() != obj.getClass() )
152 if ( !super.equals( obj ) )
157 StandardArtifactIndexRecord that = (StandardArtifactIndexRecord) obj;
159 if ( !artifactId.equals( that.artifactId ) )
163 if ( classifier != null ? !classifier.equals( that.classifier ) : that.classifier != null )
167 if ( files != null ? !files.equals( that.files ) : that.files != null )
171 if ( !groupId.equals( that.groupId ) )
175 if ( repository != null ? !repository.equals( that.repository ) : that.repository != null )
179 if ( sha1Checksum != null ? !sha1Checksum.equals( that.sha1Checksum ) : that.sha1Checksum != null )
183 if ( type != null ? !type.equals( that.type ) : that.type != null )
187 if ( !version.equals( that.version ) )
191 if ( !baseVersion.equals( that.baseVersion ) )
195 if ( packaging != null ? !packaging.equals( that.packaging ) : that.packaging != null )
199 if ( pluginPrefix != null ? !pluginPrefix.equals( that.pluginPrefix ) : that.pluginPrefix != null )
203 if ( projectName != null ? !projectName.equals( that.projectName ) : that.projectName != null )
207 if ( inceptionYear != null ? !inceptionYear.equals( that.inceptionYear ) : that.inceptionYear != null )
211 if ( projectDescription != null ? !projectDescription.equals( that.projectDescription )
212 : that.projectDescription != null )
220 public int hashCode()
222 int result = super.hashCode();
223 result = 31 * result + ( sha1Checksum != null ? sha1Checksum.hashCode() : 0 );
224 result = 31 * result + groupId.hashCode();
225 result = 31 * result + artifactId.hashCode();
226 result = 31 * result + version.hashCode();
227 result = 31 * result + baseVersion.hashCode();
228 result = 31 * result + ( classifier != null ? classifier.hashCode() : 0 );
229 result = 31 * result + ( type != null ? type.hashCode() : 0 );
230 result = 31 * result + ( files != null ? files.hashCode() : 0 );
231 result = 31 * result + ( repository != null ? repository.hashCode() : 0 );
232 result = 31 * result + ( packaging != null ? packaging.hashCode() : 0 );
233 result = 31 * result + ( pluginPrefix != null ? pluginPrefix.hashCode() : 0 );
234 result = 31 * result + ( inceptionYear != null ? inceptionYear.hashCode() : 0 );
235 result = 31 * result + ( projectName != null ? projectName.hashCode() : 0 );
236 result = 31 * result + ( projectDescription != null ? projectDescription.hashCode() : 0 );
240 public String getSha1Checksum()
245 public String getGroupId()
250 public String getArtifactId()
255 public String getVersion()
260 public String getClassifier()
265 public String getType()
270 public List getFiles()
275 public String getRepository()
280 public String getPackaging()
285 public String getPluginPrefix()
290 public void setPackaging( String packaging )
292 this.packaging = packaging;
295 public void setPluginPrefix( String pluginPrefix )
297 this.pluginPrefix = pluginPrefix;
300 public void setInceptionYear( String inceptionYear )
302 this.inceptionYear = inceptionYear;
305 public void setProjectDescription( String description )
307 this.projectDescription = description;
310 public void setProjectName( String projectName )
312 this.projectName = projectName;
315 public String getInceptionYear()
317 return inceptionYear;
320 public String getProjectDescription()
322 return projectDescription;
325 public String getProjectName()
330 public void setBaseVersion( String baseVersion )
332 this.baseVersion = baseVersion;
335 public String getBaseVersion()