001    // =================== DO NOT EDIT THIS FILE ====================
002    // Generated by Modello 1.7,
003    // any modifications will be overwritten.
004    // ==============================================================
005    
006    package org.apache.archiva.model;
007    
008    /**
009     * A reference to another (unversioned) Project.
010     * 
011     * @version $Revision$ $Date$
012     */
013    @SuppressWarnings( "all" )
014    public class ProjectReference
015        implements java.io.Serializable
016    {
017    
018          //--------------------------/
019         //- Class/Member Variables -/
020        //--------------------------/
021    
022        /**
023         * 
024         *             The Group ID of the project reference.
025         *           
026         */
027        private String groupId;
028    
029        /**
030         * 
031         *             The Artifact ID of the project reference.
032         *           
033         */
034        private String artifactId;
035    
036    
037          //-----------/
038         //- Methods -/
039        //-----------/
040    
041        /**
042         * Get the Artifact ID of the project reference.
043         * 
044         * @return String
045         */
046        public String getArtifactId()
047        {
048            return this.artifactId;
049        } //-- String getArtifactId()
050    
051        /**
052         * Get the Group ID of the project reference.
053         * 
054         * @return String
055         */
056        public String getGroupId()
057        {
058            return this.groupId;
059        } //-- String getGroupId()
060    
061        /**
062         * Set the Artifact ID of the project reference.
063         * 
064         * @param artifactId
065         */
066        public void setArtifactId( String artifactId )
067        {
068            this.artifactId = artifactId;
069        } //-- void setArtifactId( String )
070    
071        /**
072         * Set the Group ID of the project reference.
073         * 
074         * @param groupId
075         */
076        public void setGroupId( String groupId )
077        {
078            this.groupId = groupId;
079        } //-- void setGroupId( String )
080    
081        
082        private static final long serialVersionUID = 8947981859537138991L;
083              
084        
085        private static String defaultString( String value )
086        {
087            if ( value == null )
088            {
089                return "";
090            }
091            
092            return value.trim();
093        }
094              
095        public static String toKey( ProjectReference reference )
096        {
097            StringBuilder key = new StringBuilder();
098    
099            key.append( defaultString( reference.getGroupId() ) ).append( ":" );
100            key.append( defaultString( reference.getArtifactId() ) );
101    
102            return key.toString();
103        }
104              
105    }