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;
46 public Artifact( String repositoryId, String groupId, String artifactId, String version, String type )
48 this.repositoryId = repositoryId;
49 this.groupId = groupId;
50 this.artifactId = artifactId;
51 this.version = version;
55 public String getGroupId()
60 public String getArtifactId()
65 public String getVersion()
70 public String getType()
75 public String getRepositoryId()
80 public void setGroupId( String groupId )
82 this.groupId = groupId;
85 public void setArtifactId( String artifactId )
87 this.artifactId = artifactId;
90 public void setVersion( String version )
92 this.version = version;
95 public void setType( String type )
100 public void setRepositoryId( String repositoryId )
102 this.repositoryId = repositoryId;
106 public boolean equals( Object o )
112 if ( o == null || getClass() != o.getClass() )
117 Artifact artifact = (Artifact) o;
119 if ( !artifactId.equals( artifact.artifactId ) )
123 if ( !groupId.equals( artifact.groupId ) )
127 if ( !repositoryId.equals( artifact.repositoryId ) )
131 if ( type != null ? !type.equals( artifact.type ) : artifact.type != null )
135 if ( !version.equals( artifact.version ) )
144 public int hashCode()
146 int result = repositoryId.hashCode();
147 result = 31 * result + groupId.hashCode();
148 result = 31 * result + artifactId.hashCode();
149 result = 31 * result + version.hashCode();
150 result = 31 * result + ( type != null ? type.hashCode() : 0 );
155 public String toString()
157 final StringBuilder sb = new StringBuilder();
158 sb.append( "Artifact" );
159 sb.append( "{repositoryId='" ).append( repositoryId ).append( '\'' );
160 sb.append( ", groupId='" ).append( groupId ).append( '\'' );
161 sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
162 sb.append( ", version='" ).append( version ).append( '\'' );
163 sb.append( ", type='" ).append( type ).append( '\'' );
165 return sb.toString();