This project has retired. For details please refer to its Attic page.
ProjectVersionReference xref
View Javadoc
1   package org.apache.archiva.metadata.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  public class ProjectVersionReference
23  {
24      private ReferenceType referenceType;
25  
26      private String projectId;
27  
28      private String namespace;
29  
30      private String projectVersion;
31  
32      public ProjectVersionReference()
33      {
34          // no op
35      }
36  
37      public ProjectVersionReference( ReferenceType referenceType, String projectId, String namespace,
38                                      String projectVersion )
39      {
40          this.referenceType = referenceType;
41          this.projectId = projectId;
42          this.namespace = namespace;
43          this.projectVersion = projectVersion;
44      }
45  
46      public void setReferenceType( ReferenceType referenceType )
47      {
48          this.referenceType = referenceType;
49      }
50  
51      public void setNamespace( String namespace )
52      {
53          this.namespace = namespace;
54      }
55  
56      public void setProjectId( String projectId )
57      {
58          this.projectId = projectId;
59      }
60  
61      public ReferenceType getReferenceType()
62      {
63          return referenceType;
64      }
65  
66      public String getProjectId()
67      {
68          return projectId;
69      }
70  
71      public String getProjectVersion()
72      {
73          return projectVersion;
74      }
75  
76      public String getNamespace()
77      {
78          return namespace;
79      }
80  
81      public void setProjectVersion( String projectVersion )
82      {
83          this.projectVersion = projectVersion;
84      }
85  
86      public enum ReferenceType
87      {
88          DEPENDENCY,
89          PARENT
90      }
91  
92      @Override
93      public boolean equals( Object o )
94      {
95          if ( this == o )
96          {
97              return true;
98          }
99          if ( o == null || getClass() != o.getClass() )
100         {
101             return false;
102         }
103 
104         ProjectVersionReferenceorg/apache/archiva/metadata/model/ProjectVersionReference.html#ProjectVersionReference">ProjectVersionReference that = (ProjectVersionReference) o;
105 
106         if ( !namespace.equals( that.namespace ) )
107         {
108             return false;
109         }
110         if ( !projectId.equals( that.projectId ) )
111         {
112             return false;
113         }
114         if ( !projectVersion.equals( that.projectVersion ) )
115         {
116             return false;
117         }
118         if ( referenceType != that.referenceType )
119         {
120             return false;
121         }
122 
123         return true;
124     }
125 
126     @Override
127     public int hashCode()
128     {
129         int result = referenceType.hashCode();
130         result = 31 * result + projectId.hashCode();
131         result = 31 * result + namespace.hashCode();
132         result = 31 * result + projectVersion.hashCode();
133         return result;
134     }
135 }