1 package org.apache.archiva.metadata.model;
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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
22 import java.util.Date;
24 public class ArtifactMetadata
25 extends FacetedMetadata
31 private String version;
33 private Date fileLastModified;
35 private Date whenGathered;
41 private String namespace;
43 private String project;
45 private String repositoryId;
52 public void setId( String id )
62 public void setSize( long size )
67 public String getVersion()
72 public void setVersion( String version )
74 this.version = version;
77 public void setFileLastModified( long fileLastModified )
79 this.fileLastModified = new Date( fileLastModified );
82 public void setWhenGathered( Date whenGathered )
84 this.whenGathered = whenGathered;
87 public void setMd5( String md5 )
92 public void setSha1( String sha1 )
97 public Date getWhenGathered()
102 public String getMd5()
107 public String getSha1()
112 public Date getFileLastModified()
115 return fileLastModified;
118 public String getNamespace()
123 public void setNamespace( String namespace )
125 this.namespace = namespace;
128 public void setProject( String project )
130 this.project = project;
133 public String getProject()
138 public String getRepositoryId()
143 public void setRepositoryId( String repositoryId )
145 this.repositoryId = repositoryId;
149 public boolean equals( Object o )
155 if ( o == null || getClass() != o.getClass() )
160 ArtifactMetadata that = (ArtifactMetadata) o;
162 if ( size != that.size )
166 if ( !fileLastModified.equals( that.fileLastModified ) )
170 if ( !id.equals( that.id ) )
174 if ( md5 != null ? !md5.equals( that.md5 ) : that.md5 != null )
178 if ( namespace != null ? !namespace.equals( that.namespace ) : that.namespace != null )
182 if ( project != null ? !project.equals( that.project ) : that.project != null )
186 if ( repositoryId != null ? !repositoryId.equals( that.repositoryId ) : that.repositoryId != null )
190 if ( sha1 != null ? !sha1.equals( that.sha1 ) : that.sha1 != null )
194 if ( !version.equals( that.version ) )
198 if ( !whenGathered.equals( that.whenGathered ) )
207 public String toString()
209 return "ArtifactMetadata{" + "id='" + id + '\'' + ", size=" + size + ", version='" + version + '\'' +
210 ", fileLastModified=" + fileLastModified + ", whenGathered=" + whenGathered + ", md5='" + md5 + '\'' +
211 ", sha1='" + sha1 + '\'' + ", namespace='" + namespace + '\'' + ", project='" + project + '\'' +
212 ", repositoryId='" + repositoryId + '\'' + '}';