1 /**
2 * Portions of this software was developed by employees of the National Institute
3 * of Standards and Technology (NIST), an agency of the Federal Government and is
4 * being made available as a public service. Pursuant to title 17 United States
5 * Code Section 105, works of NIST employees are not subject to copyright
6 * protection in the United States. This software may be subject to foreign
7 * copyright. Permission in the United States and in foreign countries, to the
8 * extent that NIST may hold copyright, to use, copy, modify, create derivative
9 * works, and distribute this software and its documentation without fee is hereby
10 * granted on a non-exclusive basis, provided that this notice and disclaimer
11 * of warranty appears in all copies.
12 *
13 * THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND, EITHER
14 * EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY
15 * THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND FREEDOM FROM
17 * INFRINGEMENT, AND ANY WARRANTY THAT THE DOCUMENTATION WILL CONFORM TO THE
18 * SOFTWARE, OR ANY WARRANTY THAT THE SOFTWARE WILL BE ERROR FREE. IN NO EVENT
19 * SHALL NIST BE LIABLE FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT,
20 * INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM,
21 * OR IN ANY WAY CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY,
22 * CONTRACT, TORT, OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY PERSONS OR
23 * PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED FROM, OR AROSE OUT
24 * OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR SERVICES PROVIDED HEREUNDER.
25 */
26
27 package gov.nist.secauto.swid.builder;
28
29 import static gov.nist.secauto.swid.builder.util.Util.requireNonEmpty;
30
31 public class MetaBuilder extends AbstractLanguageSpecificBuilder<MetaBuilder> {
32 public static MetaBuilder create() {
33 return new MetaBuilder();
34 }
35
36 private String activationStatus;
37 private String channelType;
38 private String colloquialVersion;
39 private String description;
40 private String edition;
41 private String entitlementDataRequired;
42 private String entitlementKey;
43 private String generator;
44 private String persistentId;
45 private String productBaseName;
46 private String productFamily;
47 private String revision;
48 private String summary;
49 private String unspscCode;
50 private String unspscVersion;
51
52 protected MetaBuilder() {
53 super();
54 }
55
56 @Override
57 public void reset() {
58 this.activationStatus = null;
59 this.channelType = null;
60 this.colloquialVersion = null;
61 this.description = null;
62 this.edition = null;
63 this.entitlementDataRequired = null;
64 this.entitlementKey = null;
65 this.generator = null;
66 this.persistentId = null;
67 this.productBaseName = null;
68 this.productFamily = null;
69 this.revision = null;
70 this.summary = null;
71 this.unspscCode = null;
72 this.unspscVersion = null;
73 }
74
75 /**
76 * Retrieves the activation status.
77 *
78 * @return the activationStatus or {@code null} if one hasn't been set
79 */
80 public String getActivationStatus() {
81 return activationStatus;
82 }
83
84 /**
85 * Sets the activation status.
86 *
87 * @param activationStatus
88 * the activationStatus to set
89 * @return the current builder instance
90 */
91 public MetaBuilder setActivationStatus(String activationStatus) {
92 requireNonEmpty(activationStatus, "activationStatus");
93 this.activationStatus = activationStatus;
94 return this;
95 }
96
97 /**
98 * Retrieves the channel type.
99 *
100 * @return the channelType or {@code null} if one hasn't been set
101 */
102 public String getChannelType() {
103 return channelType;
104 }
105
106 /**
107 * Sets the channel type.
108 *
109 * @param channelType
110 * the channelType to set
111 * @return the current builder instance
112 */
113 public MetaBuilder setChannelType(String channelType) {
114 requireNonEmpty(channelType, "channelType");
115 this.channelType = channelType;
116 return this;
117 }
118
119 /**
120 * Retrieves the colloquial version.
121 *
122 * @return the colloquialVersion or {@code null} if one hasn't been set
123 */
124 public String getColloquialVersion() {
125 return colloquialVersion;
126 }
127
128 /**
129 * Sets the colloquial version.
130 *
131 * @param colloquialVersion
132 * the colloquialVersion to set
133 * @return the current builder instance
134 */
135 public MetaBuilder setColloquialVersion(String colloquialVersion) {
136 requireNonEmpty(colloquialVersion, "colloquialVersion");
137 this.colloquialVersion = colloquialVersion;
138 return this;
139 }
140
141 /**
142 * Retrieves the description.
143 *
144 * @return the description or {@code null} if one hasn't been set
145 */
146 public String getDescription() {
147 return description;
148 }
149
150 /**
151 * Sets the description.
152 *
153 * @param description
154 * the description to set
155 * @return the current builder instance
156 */
157 public MetaBuilder setDescription(String description) {
158 requireNonEmpty(description, "description");
159 this.description = description;
160 return this;
161 }
162
163 /**
164 * Retrieves the edition.
165 *
166 * @return the edition or {@code null} if one hasn't been set
167 */
168 public String getEdition() {
169 return edition;
170 }
171
172 /**
173 * Sets the edition.
174 *
175 * @param edition
176 * the edition to set
177 * @return the current builder instance
178 */
179 public MetaBuilder setEdition(String edition) {
180 requireNonEmpty(edition, "edition");
181 this.edition = edition;
182 return this;
183 }
184
185 /**
186 * Retrieves the indicator of if entitlement data is required.
187 *
188 * @return the entitlementDataRequired or {@code null} if one hasn't been set
189 */
190 public String getEntitlementDataRequired() {
191 return entitlementDataRequired;
192 }
193
194 /**
195 * Sets the indicator of if entitlement data is required.
196 *
197 * @param entitlementDataRequired
198 * the entitlementDataRequired to set
199 * @return the current builder instance
200 */
201 public MetaBuilder setEntitlementDataRequired(String entitlementDataRequired) {
202 requireNonEmpty(entitlementDataRequired, "entitlementDataRequired");
203 this.entitlementDataRequired = entitlementDataRequired;
204 return this;
205 }
206
207 /**
208 * Retrieves the entitlement key.
209 *
210 * @return the entitlementKey or {@code null} if one hasn't been set
211 */
212 public String getEntitlementKey() {
213 return entitlementKey;
214 }
215
216 /**
217 * Sets the entitlement key.
218 *
219 * @param entitlementKey
220 * the entitlementKey to set
221 * @return the current builder instance
222 */
223 public MetaBuilder setEntitlementKey(String entitlementKey) {
224 requireNonEmpty(entitlementKey, "entitlementKey");
225 this.entitlementKey = entitlementKey;
226 return this;
227 }
228
229 /**
230 * Retrieves the generator.
231 *
232 * @return the generator or {@code null} if one hasn't been set
233 */
234 public String getGenerator() {
235 return generator;
236 }
237
238 /**
239 * Sets the generator.
240 *
241 * @param generator
242 * the generator to set
243 * @return the current builder instance
244 */
245 public MetaBuilder setGenerator(String generator) {
246 requireNonEmpty(generator, "generator");
247 this.generator = generator;
248 return this;
249 }
250
251 /**
252 * Retrieves the persistentId.
253 *
254 * @return the persistentId or {@code null} if one hasn't been set
255 */
256 public String getPersistentId() {
257 return persistentId;
258 }
259
260 /**
261 * Sets the persistentId.
262 *
263 * @param persistentId
264 * the persistentId to set
265 * @return the current builder instance
266 */
267 public MetaBuilder setPersistentId(String persistentId) {
268 requireNonEmpty(persistentId, "persistentId");
269 this.persistentId = persistentId;
270 return this;
271 }
272
273 /**
274 * Retrieves the product base name.
275 *
276 * @return the productBaseName or {@code null} if one hasn't been set
277 */
278 public String getProductBaseName() {
279 return productBaseName;
280 }
281
282 /**
283 * Sets the product base name.
284 *
285 * @param productBaseName
286 * the productBaseName to set
287 * @return the current builder instance
288 */
289 public MetaBuilder setProductBaseName(String productBaseName) {
290 requireNonEmpty(productBaseName, "productBaseName");
291 this.productBaseName = productBaseName;
292 return this;
293 }
294
295 /**
296 * Retrieves the product family.
297 *
298 * @return the productFamily or {@code null} if one hasn't been set
299 */
300 public String getProductFamily() {
301 return productFamily;
302 }
303
304 /**
305 * Sets the product family.
306 *
307 * @param productFamily
308 * the productFamily to set
309 * @return the current builder instance
310 */
311 public MetaBuilder setProductFamily(String productFamily) {
312 requireNonEmpty(productFamily, "productFamily");
313 this.productFamily = productFamily;
314 return this;
315 }
316
317 /**
318 * Retrieves the revision.
319 *
320 * @return the revision or {@code null} if one hasn't been set
321 */
322 public String getRevision() {
323 return revision;
324 }
325
326 /**
327 * Sets the revision.
328 *
329 * @param revision
330 * the revision to set
331 * @return the current builder instance
332 */
333 public MetaBuilder setRevision(String revision) {
334 requireNonEmpty(revision, "revision");
335 this.revision = revision;
336 return this;
337 }
338
339 /**
340 * Retrieves the summary.
341 *
342 * @return the summary or {@code null} if one hasn't been set
343 */
344 public String getSummary() {
345 return summary;
346 }
347
348 /**
349 * Sets the summary.
350 *
351 * @param summary
352 * the summary to set
353 * @return the current builder instance
354 */
355 public MetaBuilder setSummary(String summary) {
356 requireNonEmpty(summary, "summary");
357 this.summary = summary;
358 return this;
359 }
360
361 /**
362 * Retrieves the UNSPSC code.
363 *
364 * @return the unspscCode or {@code null} if one hasn't been set
365 */
366 public String getUnspscCode() {
367 return unspscCode;
368 }
369
370 /**
371 * Sets the UNSPSC code.
372 *
373 * @param unspscCode
374 * the unspscCode to set
375 * @return the current builder instance
376 */
377 public MetaBuilder setUnspscCode(String unspscCode) {
378 requireNonEmpty(unspscCode, "unspscCode");
379 this.unspscCode = unspscCode;
380 return this;
381 }
382
383 /**
384 * Retrieves the UNSPSC version.
385 *
386 * @return the unspscVersion or {@code null} if one hasn't been set
387 */
388 public String getUnspscVersion() {
389 return unspscVersion;
390 }
391
392 /**
393 * Sets the UNSPSC version.
394 *
395 * @param unspscVersion
396 * the unspscVersion to set
397 * @return the current builder instance
398 */
399 public MetaBuilder setUnspscVersion(String unspscVersion) {
400 requireNonEmpty(unspscVersion, "unspscVersion");
401 this.unspscVersion = unspscVersion;
402 return this;
403 }
404
405 @Override
406 public void validate() throws ValidationException {
407 super.validate();
408 }
409 }