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 = "dependency" )
26 public class Dependency
27 implements Serializable
29 private String groupId;
31 private String artifactId;
33 private String version;
35 private String classifier;
41 public Dependency( String groupId, String artifactId, String version, String classifier, String type, String scope )
43 this.groupId = groupId;
44 this.artifactId = artifactId;
45 this.version = version;
46 this.classifier = classifier;
51 public String getGroupId()
56 public void setGroupId( String groupId )
58 this.groupId = groupId;
61 public String getArtifactId()
66 public void setArtifactId( String artifactId )
68 this.artifactId = artifactId;
71 public String getVersion()
76 public void setVersion( String version )
78 this.version = version;
81 public String getClassifier()
86 public void setClassifier( String classifier )
88 this.classifier = classifier;
91 public String getType()
96 public void setType( String type )
101 public String getScope()
106 public void setScope( String scope )
112 public String toString()
114 return "Dependency{" + "groupId='" + groupId + '\'' + ", artifactId='" + artifactId + '\'' + ", version='"
115 + version + '\'' + ", classifier='" + classifier + '\'' + ", type='" + type + '\'' + ", scope='" + scope
120 public boolean equals( Object o )
126 if ( o == null || getClass() != o.getClass() )
131 Dependency that = (Dependency) o;
133 if ( !artifactId.equals( that.artifactId ) )
137 if ( classifier != null ? !classifier.equals( that.classifier ) : that.classifier != null )
141 if ( !groupId.equals( that.groupId ) )
145 if ( scope != null ? !scope.equals( that.scope ) : that.scope != null )
149 if ( type != null ? !type.equals( that.type ) : that.type != null )
153 if ( !version.equals( that.version ) )
162 public int hashCode()
164 int result = groupId.hashCode();
165 result = 31 * result + artifactId.hashCode();
166 result = 31 * result + version.hashCode();
167 result = 31 * result + ( classifier != null ? classifier.hashCode() : 0 );
168 result = 31 * result + ( type != null ? type.hashCode() : 0 );
169 result = 31 * result + ( scope != null ? scope.hashCode() : 0 );