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