1 /*
2 * dpkg - Debian Package library and the Debian Package Maven plugin
3 * (c) Copyright 2016 Gerrit Hohl
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 package net.sourceforge.javadpkg.plugin.cfg;
20
21 import java.io.File;
22 import java.util.ArrayList;
23 import java.util.List;
24
25 import org.apache.maven.plugins.annotations.Parameter;
26
27 /**
28 * <p>
29 * The copyright configuration.
30 * </p>
31 *
32 * @author Gerrit Hohl (gerrit-hohl@users.sourceforge.net)
33 * @version <b>1.0</b>, 09.05.2016 by Gerrit Hohl
34 */
35 public class CopyrightConfiguration {
36
37
38 /** The file. */
39 @Parameter(name = "file")
40 private File file;
41 /** The name upstream uses for the software. */
42 @Parameter(name = "upstreamName")
43 private String upstreamName;
44 /** The upstream contact. */
45 @Parameter(name = "upstreamContact")
46 private String upstreamContact;
47 /** The source. */
48 @Parameter(name = "source")
49 private String source;
50 /** The disclaimer. */
51 @Parameter(name = "disclaimer")
52 private String disclaimer;
53 /** The comment. */
54 @Parameter(name = "comment")
55 private String comment;
56 /** The license configuration. */
57 @Parameter(name = "license")
58 private CopyrightLicenseConfiguration license;
59 /** The copyright. */
60 @Parameter(name = "copyright")
61 private String copyright;
62 /** The files copyright configurations. */
63 @Parameter(name = "files")
64 private List<CopyrightFilesConfiguration> files;
65 /** The configurations of the licenses. */
66 @Parameter(name = "licenses")
67 private List<CopyrightLicenseConfiguration> licenses;
68
69
70 /**
71 * <p>
72 * Creates the configuration.
73 * </p>
74 */
75 public CopyrightConfiguration() {
76 super();
77
78 this.file = null;
79 this.upstreamName = null;
80 this.upstreamContact = null;
81 this.source = null;
82 this.disclaimer = null;
83 this.comment = null;
84 this.license = null;
85 this.copyright = null;
86 this.files = new ArrayList<>();
87 this.licenses = new ArrayList<>();
88 }
89
90
91 /**
92 * <p>
93 * Returns the file.
94 * </p>
95 *
96 * @return The file or <code>null</code>, if no file is set.
97 */
98 public File getFile() {
99 return this.file;
100 }
101
102
103 /**
104 * <p>
105 * Sets the file.
106 * </p>
107 *
108 * @param file
109 * The file.
110 */
111 public void setFile(File file) {
112 this.file = file;
113 }
114
115
116 /**
117 * <p>
118 * Returns the name upstream uses for the software.
119 * </p>
120 *
121 * @return The name or <code>null</code>, if no name is set.
122 */
123 public String getUpstreamName() {
124 return this.upstreamName;
125 }
126
127
128 /**
129 * <p>
130 * Sets the name upstream uses for the software.
131 * </p>
132 *
133 * @param upstreamName
134 * The name.
135 */
136 public void setUpstreamName(String upstreamName) {
137 this.upstreamName = upstreamName;
138 }
139
140
141 /**
142 * <p>
143 * Returns the upstream contact.
144 * </p>
145 *
146 * @return The upstream contact or <code>null</code>, if no upstream contact
147 * is set.
148 */
149 public String getUpstreamContact() {
150 return this.upstreamContact;
151 }
152
153
154 /**
155 * <p>
156 * Sets the upstream contact.
157 * </p>
158 *
159 * @param upstreamContact
160 * The upstream contact.
161 */
162 public void setUpstreamContact(String upstreamContact) {
163 this.upstreamContact = upstreamContact;
164 }
165
166
167 /**
168 * <p>
169 * Returns the source.
170 * </p>
171 *
172 * @return The source.
173 */
174 public String getSource() {
175 return this.source;
176 }
177
178
179 /**
180 * <p>
181 * Sets the source.
182 * </p>
183 *
184 * @param source
185 * The source.
186 */
187 public void setSource(String source) {
188 this.source = source;
189 }
190
191
192 /**
193 * <p>
194 * Returns the disclaimer.
195 * </p>
196 *
197 * @return The disclaimer.
198 */
199 public String getDisclaimer() {
200 return this.disclaimer;
201 }
202
203
204 /**
205 * <p>
206 * Sets the disclaimer.
207 * </p>
208 *
209 * @param disclaimer
210 * The disclaimer.
211 */
212 public void setDisclaimer(String disclaimer) {
213 this.disclaimer = disclaimer;
214 }
215
216
217 /**
218 * <p>
219 * Returns the comment.
220 * </p>
221 *
222 * @return The comment or <code>null</code>, if no comment is set.
223 */
224 public String getComment() {
225 return this.comment;
226 }
227
228
229 /**
230 * <p>
231 * Sets the comment.
232 * </p>
233 *
234 * @param comment
235 * The comment.
236 */
237 public void setComment(String comment) {
238 this.comment = comment;
239 }
240
241
242 /**
243 * <p>
244 * Returns the license configuration.
245 * </p>
246 *
247 * @return The license configuration or <code>null</code>, if no license
248 * configuration is set.
249 */
250 public CopyrightLicenseConfiguration getLicense() {
251 return this.license;
252 }
253
254
255 /**
256 * <p>
257 * Sets the license configuration.
258 * </p>
259 *
260 * @param license
261 * The license configuration.
262 */
263 public void setLicense(CopyrightLicenseConfiguration license) {
264 this.license = license;
265 }
266
267
268 /**
269 * <p>
270 * Returns the copyright.
271 * </p>
272 *
273 * @return The copyright or <code>null</code>, if no copyright is set.
274 */
275 public String getCopyright() {
276 return this.copyright;
277 }
278
279
280 /**
281 * <p>
282 * Sets the copyright.
283 * </p>
284 *
285 * @param copyright
286 * The copyright.
287 */
288 public void setCopyright(String copyright) {
289 this.copyright = copyright;
290 }
291
292
293 /**
294 * <p>
295 * Returns the files copyright configurations.
296 * </p>
297 *
298 * @return The files copyright configurations.
299 */
300 public List<CopyrightFilesConfiguration> getFiles() {
301 return (new ArrayList<>(this.files));
302 }
303
304
305 /**
306 * <p>
307 * Sets the files copyright configurations.
308 * </p>
309 *
310 * @param files
311 * The files copyright configurations.
312 */
313 public void setFiles(List<CopyrightFilesConfiguration> files) {
314 if (files == null) {
315 this.files = new ArrayList<>();
316 } else {
317 this.files = new ArrayList<>(files);
318 }
319 }
320
321
322 /**
323 * <p>
324 * Returns the configurations of the licenses.
325 * </p>
326 *
327 * @return The configurations.
328 */
329 public List<CopyrightLicenseConfiguration> getLicenses() {
330 return (new ArrayList<>(this.licenses));
331 }
332
333
334 /**
335 * <p>
336 * Sets the configurations of the licenses.
337 * </p>
338 *
339 * @param licenses
340 * The configurations.
341 */
342 public void setLicenses(List<CopyrightLicenseConfiguration> licenses) {
343 if (licenses == null) {
344 this.licenses = new ArrayList<>();
345 } else {
346 this.licenses = new ArrayList<>(licenses);
347 }
348 }
349
350
351 }