Coverage Report - org.apache.maven.model.Extension
 
Classes in this File Line Coverage Branch Coverage Complexity
Extension
46 %
13/28
30 %
6/20
2,111
 
 1  
 /*
 2  
  =================== DO NOT EDIT THIS FILE ====================
 3  
  Generated by Modello 1.0.1 on 2009-07-11 18:25:45,
 4  
  any modifications will be overwritten.
 5  
  ==============================================================
 6  
  */
 7  
 
 8  
 package org.apache.maven.model;
 9  
 
 10  
 /**
 11  
  * Describes a build extension to utilise.
 12  
  * 
 13  
  * @version $Revision$ $Date$
 14  
  */
 15  4
 public class Extension
 16  
     implements java.io.Serializable
 17  
 {
 18  
 
 19  
       //--------------------------/
 20  
      //- Class/Member Variables -/
 21  
     //--------------------------/
 22  
 
 23  
     /**
 24  
      * The group ID of the extension's artifact.
 25  
      */
 26  
     private String groupId;
 27  
 
 28  
     /**
 29  
      * The artifact ID of the extension.
 30  
      */
 31  
     private String artifactId;
 32  
 
 33  
     /**
 34  
      * The version of the extension.
 35  
      */
 36  
     private String version;
 37  
 
 38  
 
 39  
       //-----------/
 40  
      //- Methods -/
 41  
     //-----------/
 42  
 
 43  
     /**
 44  
      * Get the artifact ID of the extension.
 45  
      * 
 46  
      * @return String
 47  
      */
 48  
     public String getArtifactId()
 49  
     {
 50  2
         return this.artifactId;
 51  
     } //-- String getArtifactId()
 52  
 
 53  
     /**
 54  
      * Get the group ID of the extension's artifact.
 55  
      * 
 56  
      * @return String
 57  
      */
 58  
     public String getGroupId()
 59  
     {
 60  2
         return this.groupId;
 61  
     } //-- String getGroupId()
 62  
 
 63  
     /**
 64  
      * Get the version of the extension.
 65  
      * 
 66  
      * @return String
 67  
      */
 68  
     public String getVersion()
 69  
     {
 70  2
         return this.version;
 71  
     } //-- String getVersion()
 72  
 
 73  
     /**
 74  
      * Set the artifact ID of the extension.
 75  
      * 
 76  
      * @param artifactId
 77  
      */
 78  
     public void setArtifactId( String artifactId )
 79  
     {
 80  0
         this.artifactId = artifactId;
 81  0
     } //-- void setArtifactId( String )
 82  
 
 83  
     /**
 84  
      * Set the group ID of the extension's artifact.
 85  
      * 
 86  
      * @param groupId
 87  
      */
 88  
     public void setGroupId( String groupId )
 89  
     {
 90  0
         this.groupId = groupId;
 91  0
     } //-- void setGroupId( String )
 92  
 
 93  
     /**
 94  
      * Set the version of the extension.
 95  
      * 
 96  
      * @param version
 97  
      */
 98  
     public void setVersion( String version )
 99  
     {
 100  0
         this.version = version;
 101  0
     } //-- void setVersion( String )
 102  
 
 103  
 
 104  
             
 105  
     /**
 106  
      * Gets the key of the extension. The key is used to merge extensions inherited from a parent with the extensions
 107  
      * of the current project.
 108  
      *
 109  
      * @return The key of the extension, i.e. <code>groupId:artifactId</code>.
 110  
      */
 111  
     public String getKey()
 112  
     {
 113  0
         return new StringBuffer( 128 ).append( getGroupId() ).append( ':' ).append( getArtifactId() ).toString();
 114  
     }
 115  
 
 116  
     /**
 117  
      * @see java.lang.Object#equals(java.lang.Object)
 118  
      */
 119  
     public boolean equals( Object o )
 120  
     {
 121  2
         if ( this == o )
 122  
         {
 123  1
             return true;
 124  
         }
 125  
 
 126  1
         if ( !( o instanceof Extension ) )
 127  
         {
 128  1
             return false;
 129  
         }
 130  
 
 131  0
         Extension e = (Extension) o;
 132  
 
 133  0
         if ( !e.getArtifactId().equals( getArtifactId() ) )
 134  
         {
 135  0
             return false;
 136  
         }
 137  0
         else if ( !e.getGroupId().equals( getGroupId() ) )
 138  
         {
 139  0
             return false;
 140  
         }
 141  0
         else if ( e.getVersion() != null ? !e.getVersion().equals( getVersion() ) : getVersion() != null )
 142  
         {
 143  0
             return false;
 144  
         }
 145  0
         return true;
 146  
     }
 147  
 
 148  
     /**
 149  
      * @see java.lang.Object#hashCode()
 150  
      */
 151  
     public int hashCode()
 152  
     {
 153  2
         int result = 17;
 154  2
         result = 37 * result + ( getArtifactId() != null ? getArtifactId().hashCode() : 0 );
 155  2
         result = 37 * result + ( getGroupId() != null ? getGroupId().hashCode() : 0 );
 156  2
         result = 37 * result + ( getVersion() != null ? getVersion().hashCode() : 0 );
 157  2
         return result;
 158  
     }
 159  
             
 160  
           
 161  
 }