This project has retired. For details please refer to its Attic page.
Dependency xref
View Javadoc
1   package org.apache.archiva.rest.api.model;
2   
3   /*
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
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
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
19   * under the License.
20   */
21  
22  import javax.xml.bind.annotation.XmlRootElement;
23  import java.io.Serializable;
24  
25  @XmlRootElement( name = "dependency" )
26  public class Dependency
27      implements Serializable
28  {
29      private String groupId;
30  
31      private String artifactId;
32  
33      private String version;
34  
35      private String classifier;
36  
37      private String type;
38  
39      private String scope;
40  
41      public Dependency()
42      {
43          // no op
44      }
45  
46  
47      public Dependency( String groupId, String artifactId, String version, String classifier, String type, String scope )
48      {
49          this.groupId = groupId;
50          this.artifactId = artifactId;
51          this.version = version;
52          this.classifier = classifier;
53          this.type = type;
54          this.scope = scope;
55      }
56  
57      public String getGroupId()
58      {
59          return groupId;
60      }
61  
62      public void setGroupId( String groupId )
63      {
64          this.groupId = groupId;
65      }
66  
67      public String getArtifactId()
68      {
69          return artifactId;
70      }
71  
72      public void setArtifactId( String artifactId )
73      {
74          this.artifactId = artifactId;
75      }
76  
77      public String getVersion()
78      {
79          return version;
80      }
81  
82      public void setVersion( String version )
83      {
84          this.version = version;
85      }
86  
87      public String getClassifier()
88      {
89          return classifier;
90      }
91  
92      public void setClassifier( String classifier )
93      {
94          this.classifier = classifier;
95      }
96  
97      public String getType()
98      {
99          return type;
100     }
101 
102     public void setType( String type )
103     {
104         this.type = type;
105     }
106 
107     public String getScope()
108     {
109         return scope;
110     }
111 
112     public void setScope( String scope )
113     {
114         this.scope = scope;
115     }
116 
117     @Override
118     public String toString()
119     {
120         return "Dependency{" + "groupId='" + groupId + '\'' + ", artifactId='" + artifactId + '\'' + ", version='"
121             + version + '\'' + ", classifier='" + classifier + '\'' + ", type='" + type + '\'' + ", scope='" + scope
122             + '\'' + '}';
123     }
124 
125     @Override
126     public boolean equals( Object o )
127     {
128         if ( this == o )
129         {
130             return true;
131         }
132         if ( o == null || getClass() != o.getClass() )
133         {
134             return false;
135         }
136 
137         Dependency that = (Dependency) o;
138 
139         if ( !artifactId.equals( that.artifactId ) )
140         {
141             return false;
142         }
143         if ( classifier != null ? !classifier.equals( that.classifier ) : that.classifier != null )
144         {
145             return false;
146         }
147         if ( !groupId.equals( that.groupId ) )
148         {
149             return false;
150         }
151         if ( scope != null ? !scope.equals( that.scope ) : that.scope != null )
152         {
153             return false;
154         }
155         if ( type != null ? !type.equals( that.type ) : that.type != null )
156         {
157             return false;
158         }
159         if ( !version.equals( that.version ) )
160         {
161             return false;
162         }
163 
164         return true;
165     }
166 
167     @Override
168     public int hashCode()
169     {
170         int result = groupId.hashCode();
171         result = 31 * result + artifactId.hashCode();
172         result = 31 * result + version.hashCode();
173         result = 31 * result + ( classifier != null ? classifier.hashCode() : 0 );
174         result = 31 * result + ( type != null ? type.hashCode() : 0 );
175         result = 31 * result + ( scope != null ? scope.hashCode() : 0 );
176         return result;
177     }
178 }