1 /*
2 * $Id$
3 */
4
5 package org.apache.maven.model;
6
7 /**
8 *
9 *
10 * A repository contains the information needed
11 * for establishing connections with remote repository.
12 *
13 *
14 *
15 * @version $Revision$ $Date$
16 */
17 public class RepositoryBase implements java.io.Serializable {
18
19
20 //--------------------------/
21 //- Class/Member Variables -/
22 //--------------------------/
23
24 /**
25 * Field id
26 */
27 private String id;
28
29 /**
30 * Field name
31 */
32 private String name;
33
34 /**
35 * Field url
36 */
37 private String url;
38
39 /**
40 * Field layout
41 */
42 private String layout = "default";
43
44
45 //-----------/
46 //- Methods -/
47 //-----------/
48
49 /**
50 * Get
51 *
52 * A unique identifier for a repository. This is
53 * used to match the repository
54 * to configuration in the
55 * <code>settings.xml</code> file, for example.
56 *
57 *
58 */
59 public String getId()
60 {
61 return this.id;
62 } //-- String getId()
63
64 /**
65 * Get
66 *
67 * The type of layout this repository uses for
68 * locating and storing artifacts -
69 * can be <code>legacy</code> or
70 * <code>default</code>.
71 *
72 *
73 */
74 public String getLayout()
75 {
76 return this.layout;
77 } //-- String getLayout()
78
79 /**
80 * Get
81 *
82 * Human readable name of the repository.
83 *
84 *
85 */
86 public String getName()
87 {
88 return this.name;
89 } //-- String getName()
90
91 /**
92 * Get
93 *
94 * The url of the repository, in the form
95 * <code>protocol://hostname/path</code>.
96 *
97 *
98 */
99 public String getUrl()
100 {
101 return this.url;
102 } //-- String getUrl()
103
104 /**
105 * Set
106 *
107 * A unique identifier for a repository. This is
108 * used to match the repository
109 * to configuration in the
110 * <code>settings.xml</code> file, for example.
111 *
112 *
113 *
114 * @param id
115 */
116 public void setId(String id)
117 {
118 this.id = id;
119 } //-- void setId(String)
120
121 /**
122 * Set
123 *
124 * The type of layout this repository uses for
125 * locating and storing artifacts -
126 * can be <code>legacy</code> or
127 * <code>default</code>.
128 *
129 *
130 *
131 * @param layout
132 */
133 public void setLayout(String layout)
134 {
135 this.layout = layout;
136 } //-- void setLayout(String)
137
138 /**
139 * Set
140 *
141 * Human readable name of the repository.
142 *
143 *
144 *
145 * @param name
146 */
147 public void setName(String name)
148 {
149 this.name = name;
150 } //-- void setName(String)
151
152 /**
153 * Set
154 *
155 * The url of the repository, in the form
156 * <code>protocol://hostname/path</code>.
157 *
158 *
159 *
160 * @param url
161 */
162 public void setUrl(String url)
163 {
164 this.url = url;
165 } //-- void setUrl(String)
166
167
168
169 /**
170 * @see java.lang.Object#equals(java.lang.Object)
171 */
172 public boolean equals( Object obj )
173 {
174 if ( obj instanceof RepositoryBase ) {
175
176 final RepositoryBase other = (RepositoryBase) obj;
177
178 if ( id != null )
179 {
180 return id.equals( other.id );
181 }
182 return super.equals(obj);
183 }
184
185 return false;
186 }
187
188
189 private String modelEncoding = "UTF-8";
190
191 public void setModelEncoding( String modelEncoding )
192 {
193 this.modelEncoding = modelEncoding;
194 }
195
196 public String getModelEncoding()
197 {
198 return modelEncoding;
199 }}