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.util.ArrayList;
22 import java.util.List;
23
24 import org.apache.maven.plugins.annotations.Parameter;
25
26 /**
27 * <p>
28 * The files copyright configurations.
29 * </p>
30 *
31 * @author Gerrit Hohl (gerrit-hohl@users.sourceforge.net)
32 * @version <b>1.0</b>, 09.05.2016 by Gerrit Hohl
33 */
34 public class CopyrightFilesConfiguration {
35
36
37 /** The patterns for which files the copyright applies. */
38 @Parameter(name = "files", required = true)
39 private List<String> files;
40 /** The copyright. */
41 @Parameter(name = "copyright")
42 private String copyright;
43 /** The license. */
44 @Parameter(name = "license")
45 private CopyrightLicenseConfiguration license;
46 /** The comment. */
47 @Parameter(name = "comment")
48 private String comment;
49
50
51 /**
52 * <p>
53 * Creates the configuration.
54 * </p>
55 */
56 public CopyrightFilesConfiguration() {
57 super();
58
59 this.files = new ArrayList<>();
60 this.copyright = null;
61 this.license = null;
62 this.comment = null;
63 }
64
65
66 /**
67 * <p>
68 * Returns the patterns for which files the copyright applies.
69 * </p>
70 *
71 * @return The patterns.
72 */
73 public List<String> getFiles() {
74 return (new ArrayList<>(this.files));
75 }
76
77
78 /**
79 * <p>
80 * Sets the patterns for which files the copyright applies.
81 * </p>
82 *
83 * @param files
84 * The patterns.
85 */
86 public void setFiles(List<String> files) {
87 if (files == null) {
88 this.files = new ArrayList<>();
89 } else {
90 this.files = new ArrayList<>(files);
91 }
92 }
93
94
95 /**
96 * <p>
97 * Returns the copyright.
98 * </p>
99 *
100 * @return The copyright or <code>null</code>, if no copyright is set.
101 */
102 public String getCopyright() {
103 return this.copyright;
104 }
105
106
107 /**
108 * <p>
109 * Sets the copyright.
110 * </p>
111 *
112 * @param copyright
113 * The copyright.
114 */
115 public void setCopyright(String copyright) {
116 this.copyright = copyright;
117 }
118
119
120 /**
121 * <p>
122 * Returns the license.
123 * </p>
124 *
125 * @return The license or <code>null</code>, if no license is set.
126 */
127 public CopyrightLicenseConfiguration getLicense() {
128 return this.license;
129 }
130
131
132 /**
133 * <p>
134 * Sets the license.
135 * </p>
136 *
137 * @param license
138 * The license.
139 */
140 public void setLicense(CopyrightLicenseConfiguration license) {
141 this.license = license;
142 }
143
144
145 /**
146 * <p>
147 * Returns the comment.
148 * </p>
149 *
150 * @return The comment or <code>null</code>, if no comment is set.
151 */
152 public String getComment() {
153 return this.comment;
154 }
155
156
157 /**
158 * <p>
159 * Sets the comment.
160 * </p>
161 *
162 * @param comment
163 * The comment.
164 */
165 public void setComment(String comment) {
166 this.comment = comment;
167 }
168
169
170 }