View Javadoc
1   /*
2    * dpkg - Debian Package library and the Debian Package Maven plugin
3    * (c) Copyright 2015 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.control.impl;
20  
21  import net.sourceforge.javadpkg.control.Architecture;
22  import net.sourceforge.javadpkg.control.Control;
23  import net.sourceforge.javadpkg.control.Homepage;
24  import net.sourceforge.javadpkg.control.PackageDependency;
25  import net.sourceforge.javadpkg.control.PackageMaintainer;
26  import net.sourceforge.javadpkg.control.PackageMultiArchitecture;
27  import net.sourceforge.javadpkg.control.PackageVersion;
28  
29  
30  /**
31   * <p>
32   * An abstract {@link Control} implementation.
33   * </p>
34   *
35   * @author Gerrit Hohl (gerrit-hohl@users.sourceforge.net)
36   * @version <b>1.0</b>, 31.12.2015 by Gerrit Hohl
37   */
38  public abstract class AbstractControl implements Control {
39  
40  
41  	/** The source package dependency. */
42  	private PackageDependency			source;
43  	/** The version of the package. */
44  	private PackageVersion				version;
45  	/** The architecture. */
46  	private Architecture				architecture;
47  	/** The multiple architecture property. */
48  	private PackageMultiArchitecture	multiArchitecture;
49  	/** The maintainer. */
50  	private PackageMaintainer			maintainer;
51  	/** The original maintainer. */
52  	private PackageMaintainer			originalMaintainer;
53  	/** The home-page. */
54  	private Homepage					homepage;
55  										
56  										
57  	/**
58  	 * <p>
59  	 * Creates a control.
60  	 * </p>
61  	 */
62  	public AbstractControl() {
63  		super();
64  
65  		this.source = null;
66  		this.version = null;
67  		this.architecture = null;
68  		this.multiArchitecture = null;
69  		this.maintainer = null;
70  		this.homepage = null;
71  	}
72  	
73  	
74  	/**
75  	 * <p>
76  	 * Creates a control.
77  	 * </p>
78  	 *
79  	 * @param source
80  	 *            The source package dependency.
81  	 * @param version
82  	 *            The version of the package.
83  	 * @param architecture
84  	 *            The architecture.
85  	 * @param multiArchitecture
86  	 *            The multiple architecture property.
87  	 * @param maintainer
88  	 *            The maintainer.
89  	 * @param homepage
90  	 *            The home-page.
91  	 */
92  	public AbstractControl(PackageDependency source, PackageVersion version, Architecture architecture,
93  			PackageMultiArchitecture multiArchitecture, PackageMaintainer maintainer, Homepage homepage) {
94  			
95  		super();
96  
97  		this.source = source;
98  		this.version = version;
99  		this.architecture = architecture;
100 		this.multiArchitecture = multiArchitecture;
101 		this.maintainer = maintainer;
102 		this.homepage = homepage;
103 	}
104 	
105 	
106 	@Override
107 	public PackageDependency getSource() {
108 		return this.source;
109 	}
110 	
111 	
112 	/**
113 	 * <p>
114 	 * Sets the source package dependency.
115 	 * </p>
116 	 *
117 	 * @param source
118 	 *            The package dependency.
119 	 */
120 	public void setSource(PackageDependency source) {
121 		this.source = source;
122 	}
123 	
124 	
125 	@Override
126 	public PackageVersion getVersion() {
127 		return this.version;
128 	}
129 	
130 	
131 	/**
132 	 * <p>
133 	 * Sets the version of the package.
134 	 * </p>
135 	 *
136 	 * @param version
137 	 *            The version.
138 	 */
139 	public void setVersion(PackageVersion version) {
140 		this.version = version;
141 	}
142 	
143 	
144 	@Override
145 	public Architecture getArchitecture() {
146 		return this.architecture;
147 	}
148 	
149 	
150 	/**
151 	 * <p>
152 	 * Sets the architecture.
153 	 * </p>
154 	 *
155 	 * @param architecture
156 	 *            The architecture.
157 	 */
158 	public void setArchitecture(Architecture architecture) {
159 		this.architecture = architecture;
160 	}
161 
162 
163 	@Override
164 	public PackageMultiArchitecture getMultiArchitecture() {
165 		return this.multiArchitecture;
166 	}
167 	
168 	
169 	/**
170 	 * <p>
171 	 * Sets the multiple architecture property.
172 	 * </p>
173 	 *
174 	 * @param multiArchitecture
175 	 *            The multiple architecture property.
176 	 */
177 	public void setMultiArchitecture(PackageMultiArchitecture multiArchitecture) {
178 		this.multiArchitecture = multiArchitecture;
179 	}
180 	
181 	
182 	@Override
183 	public PackageMaintainer getMaintainer() {
184 		return this.maintainer;
185 	}
186 	
187 	
188 	/**
189 	 * <p>
190 	 * Sets the maintainer.
191 	 * </p>
192 	 *
193 	 * @param maintainer
194 	 *            The maintainer.
195 	 */
196 	public void setMaintainer(PackageMaintainer maintainer) {
197 		this.maintainer = maintainer;
198 	}
199 	
200 	
201 	@Override
202 	public PackageMaintainer getOriginalMaintainer() {
203 		return this.originalMaintainer;
204 	}
205 
206 
207 	/**
208 	 * <p>
209 	 * Sets the original maintainer.
210 	 * </p>
211 	 *
212 	 * @param originalMaintainer
213 	 *            The original maintainer.
214 	 */
215 	public void setOriginalMaintainer(PackageMaintainer originalMaintainer) {
216 		this.originalMaintainer = originalMaintainer;
217 	}
218 	
219 	
220 	@Override
221 	public Homepage getHomepage() {
222 		return this.homepage;
223 	}
224 	
225 	
226 	/**
227 	 * <p>
228 	 * Sets the home-page.
229 	 * </p>
230 	 *
231 	 * @param homepage
232 	 *            The home-page.
233 	 */
234 	public void setHomepage(Homepage homepage) {
235 		this.homepage = homepage;
236 	}
237 	
238 	
239 }