View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.report.projectinfo.stubs;
20  
21  import org.apache.maven.artifact.handler.ArtifactHandler;
22  import org.apache.maven.artifact.versioning.VersionRange;
23  import org.apache.maven.plugin.testing.stubs.ArtifactStub;
24  
25  /**
26   * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
27   * @version $Id$
28   */
29  public class ProjectInfoPluginArtifactStub extends ArtifactStub {
30      private String groupId;
31  
32      private String artifactId;
33  
34      private String version;
35  
36      private String packaging;
37  
38      private String type;
39  
40      private VersionRange versionRange;
41  
42      private ArtifactHandler handler;
43  
44      public ProjectInfoPluginArtifactStub(
45              String groupId, String artifactId, String version, String packaging, String type) {
46          this.groupId = groupId;
47          this.artifactId = artifactId;
48          this.version = version;
49          this.packaging = packaging;
50          this.type = type;
51          versionRange = VersionRange.createFromVersion(version);
52      }
53  
54      @Override
55      public void setGroupId(String groupId) {
56          this.groupId = groupId;
57      }
58  
59      @Override
60      public String getGroupId() {
61          return groupId;
62      }
63  
64      @Override
65      public void setArtifactId(String artifactId) {
66          this.artifactId = artifactId;
67      }
68  
69      @Override
70      public String getArtifactId() {
71          return artifactId;
72      }
73  
74      @Override
75      public void setVersion(String version) {
76          this.version = version;
77      }
78  
79      @Override
80      public String getVersion() {
81          return version;
82      }
83  
84      public void setPackaging(String packaging) {
85          this.packaging = packaging;
86      }
87  
88      public String getPackaging() {
89          return packaging;
90      }
91  
92      @Override
93      public VersionRange getVersionRange() {
94          return versionRange;
95      }
96  
97      @Override
98      public void setVersionRange(VersionRange versionRange) {
99          this.versionRange = versionRange;
100     }
101 
102     @Override
103     public ArtifactHandler getArtifactHandler() {
104         return handler;
105     }
106 
107     @Override
108     public void setArtifactHandler(ArtifactHandler handler) {
109         this.handler = handler;
110     }
111 
112     @Override
113     public String getType() {
114         return type;
115     }
116 
117     @Override
118     public void setType(String type) {
119         this.type = type;
120     }
121 }