Coverage Report - org.codehaus.plexus.component.repository.ComponentDependency
 
Classes in this File Line Coverage Branch Coverage Complexity
ComponentDependency
64 %
11/17
N/A
1
 
 1  
 package org.codehaus.plexus.component.repository;
 2  
 
 3  
 /*
 4  
  * Copyright 2001-2006 Codehaus Foundation.
 5  
  *
 6  
  * Licensed under the Apache License, Version 2.0 (the "License");
 7  
  * you may not use this file except in compliance with the License.
 8  
  * 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, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15  
  * See the License for the specific language governing permissions and
 16  
  * limitations under the License.
 17  
  */
 18  
 
 19  
 /**
 20  
  * This represents a project which this component depends upon to function
 21  
  * properly, for example, a required jar file. See Apache Maven for an
 22  
  * example of a dependency in action.
 23  
  * 
 24  
  * @author Jason van Zyl
 25  
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
 26  
  * @version $Id$
 27  
  */
 28  1
 public class ComponentDependency
 29  
 {
 30  
     private static final String DEAULT_DEPENDENCY_TYPE = "jar";
 31  
     
 32  
     private String groupId;
 33  
 
 34  
     private String artifactId;
 35  
 
 36  1
     private String type = DEAULT_DEPENDENCY_TYPE;
 37  
 
 38  
     private String version;
 39  
 
 40  
     /**
 41  
      * Gets a key for an artifact, which is an alias for a specific
 42  
      * project timeline in a group.
 43  
      * @return a key for an artifact
 44  
      */
 45  
     public String getArtifactId()
 46  
     {
 47  1
         return artifactId;
 48  
     }
 49  
 
 50  
     /**
 51  
      * Sets the dependency's artifact ID.
 52  
      * @param artifactId the artifact ID
 53  
      */
 54  
     public void setArtifactId(String artifactId)
 55  
     {
 56  1
         this.artifactId = artifactId;
 57  1
     }
 58  
 
 59  
     /**
 60  
      * Gets a key for a group, which represents a set of artifacts timelines.
 61  
      * @return a key for a group
 62  
      */
 63  
     public String getGroupId()
 64  
     {
 65  1
         return groupId;
 66  
     }
 67  
 
 68  
     /**
 69  
      * Sets the dependency's group ID.
 70  
      * @param groupId the group ID
 71  
      */
 72  
     public void setGroupId(String groupId)
 73  
     {
 74  1
         this.groupId = groupId;
 75  1
     }
 76  
 
 77  
     /**
 78  
      * Gets the type of dependency, for example a "jar".
 79  
      * @return the type of dependency
 80  
      */
 81  
     public String getType()
 82  
     {
 83  0
         return type;
 84  
     }
 85  
 
 86  
     /**
 87  
      * Sets the dependency project's type.
 88  
      * @param type the dependency's type
 89  
      */
 90  
     public void setType(String type)
 91  
     {
 92  0
         this.type = type;
 93  0
     }
 94  
 
 95  
     /**
 96  
      * Returns a specific point in a project's timeline.
 97  
      * i.e. version 1, or 2.1.4
 98  
      * @return a specific point in a project's timeline
 99  
      */
 100  
     public String getVersion()
 101  
     {
 102  1
         return version;
 103  
     }
 104  
 
 105  
     /**
 106  
      * Sets the point in a project's development timeline
 107  
      * @param version the project's version
 108  
      */
 109  
     public void setVersion(String version)
 110  
     {
 111  1
         this.version = version;
 112  1
     }
 113  
 
 114  
     public String toString()
 115  
     {
 116  0
         StringBuilder sb = new StringBuilder();
 117  
 
 118  0
         sb.append( "groupId = " ).append( groupId ).
 119  
             append( ", artifactId = " ).append( artifactId ).
 120  
             append( ", version = " ).append( version ).
 121  
             append( ", type = " ).append( type );
 122  
 
 123  0
         return sb.toString();
 124  
     }
 125  
 }