This project has retired. For details please refer to its Attic page.
VersionedReference xref
View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.7,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.archiva.model;
7   
8   /**
9    * A reference to another Versioned Project.
10   * 
11   * @version $Revision$ $Date$
12   */
13  @SuppressWarnings( "all" )
14  public class VersionedReference
15      implements java.io.Serializable
16  {
17  
18        //--------------------------/
19       //- Class/Member Variables -/
20      //--------------------------/
21  
22      /**
23       * 
24       *             The Group ID of the repository content.
25       *           
26       */
27      private String groupId;
28  
29      /**
30       * 
31       *             The Artifact ID of the repository content.
32       *           
33       */
34      private String artifactId;
35  
36      /**
37       * 
38       *             The version of the repository content.
39       *           
40       */
41      private String version;
42  
43  
44        //-----------/
45       //- Methods -/
46      //-----------/
47  
48      /**
49       * Get the Artifact ID of the repository content.
50       * 
51       * @return String
52       */
53      public String getArtifactId()
54      {
55          return this.artifactId;
56      } //-- String getArtifactId()
57  
58      /**
59       * Get the Group ID of the repository content.
60       * 
61       * @return String
62       */
63      public String getGroupId()
64      {
65          return this.groupId;
66      } //-- String getGroupId()
67  
68      /**
69       * Get the version of the repository content.
70       * 
71       * @return String
72       */
73      public String getVersion()
74      {
75          return this.version;
76      } //-- String getVersion()
77  
78      /**
79       * Set the Artifact ID of the repository content.
80       * 
81       * @param artifactId
82       */
83      public void setArtifactId( String artifactId )
84      {
85          this.artifactId = artifactId;
86      } //-- void setArtifactId( String )
87  
88      /**
89       * Set the Group ID of the repository content.
90       * 
91       * @param groupId
92       */
93      public void setGroupId( String groupId )
94      {
95          this.groupId = groupId;
96      } //-- void setGroupId( String )
97  
98      /**
99       * Set the version of the repository content.
100      * 
101      * @param version
102      */
103     public void setVersion( String version )
104     {
105         this.version = version;
106     } //-- void setVersion( String )
107 
108     
109     private static final long serialVersionUID = -6990353165677563113L;
110           
111     
112     private static String defaultString( String value )
113     {
114         if ( value == null )
115         {
116             return "";
117         }
118         
119         return value.trim();
120     }
121           
122     public static String toKey( VersionedReference reference )
123     {
124         StringBuilder key = new StringBuilder();
125 
126         key.append( defaultString( reference.getGroupId() ) ).append( ":" );
127         key.append( defaultString( reference.getArtifactId() ) ).append( ":" );
128         key.append( defaultString( reference.getVersion() ) );
129 
130         return key.toString();
131     }
132           
133 }