1 package org.apache.archiva.rest.api.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 javax.xml.bind.annotation.XmlRootElement;
23 import java.io.Serializable;
25 @XmlRootElement( name = "artifact" )
27 implements Serializable
29 private String repositoryId;
31 private String groupId;
33 private String artifactId;
35 private String version;
39 //private Date whenGathered;
47 public boolean equals( Object o )
53 if ( o == null || getClass() != o.getClass() )
58 Artifact artifact = (Artifact) o;
60 if ( !artifactId.equals( artifact.artifactId ) )
64 if ( !groupId.equals( artifact.groupId ) )
68 if ( !repositoryId.equals( artifact.repositoryId ) )
72 if ( type != null ? !type.equals( artifact.type ) : artifact.type != null )
76 if ( !version.equals( artifact.version ) )
87 int result = repositoryId.hashCode();
88 result = 31 * result + groupId.hashCode();
89 result = 31 * result + artifactId.hashCode();
90 result = 31 * result + version.hashCode();
91 result = 31 * result + ( type != null ? type.hashCode() : 0 );
96 public String toString()
98 return "Artifact{" + "repositoryId='" + repositoryId + '\'' + ", groupId='" + groupId + '\'' + ", artifactId='"
99 + artifactId + '\'' + ", version='" + version + '\'' + ", type='" + type + '\'' + '}';
102 public Artifact( String repositoryId, String groupId, String artifactId, String version, String type )
103 // String type, Date whenGathered )
105 this.repositoryId = repositoryId;
106 this.groupId = groupId;
107 this.artifactId = artifactId;
108 this.version = version;
110 //this.whenGathered = whenGathered;
113 public String getGroupId()
118 public String getArtifactId()
123 public String getVersion()
128 public String getType()
133 public String getRepositoryId()
138 /*public Date getWhenGathered()
143 public void setGroupId( String groupId )
145 this.groupId = groupId;
148 public void setArtifactId( String artifactId )
150 this.artifactId = artifactId;
153 public void setVersion( String version )
155 this.version = version;
158 public void setType( String type )
163 public void setRepositoryId( String repositoryId )
165 this.repositoryId = repositoryId;
168 /*@ServiceBeanField( "whenGathered" )
169 public void setWhenGathered( Date whenGathered )
171 this.whenGathered = whenGathered;