1 /*
2 * File: ApplicationInformation.java
3 * Created: 23.02.2006 7:33:19
4 *
5 * Copyright 2007 Michal Burda.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 package net.sf.webmancer.base;
23
24 import net.sf.webmancer.util.ContractChecker;
25
26 /**
27 * The ApplicationInformation class is intended to hold the basic information about
28 * the application -- the name of the application, version and the author's name is
29 * stored here.
30 *
31 * @author Michal Burda
32 */
33 public class ApplicationInformation implements IApplicationInformation {
34 /**
35 *
36 */
37 private String title;
38
39 /**
40 *
41 */
42 private String author;
43
44 /**
45 *
46 */
47 private String version;
48
49 /**
50 * Constructs the ApplicationInformation.
51 *
52 */
53 public ApplicationInformation() {
54 this.title = "";
55 this.author = "";
56 this.version = "";
57 }
58
59 /**
60 * Sets the application's title.
61 *
62 * @param title
63 * the application's title to set
64 */
65 public void setTitle(final String title) {
66 ContractChecker.mustNotBeNull(title, "title");
67 this.title = title;
68 }
69
70 /**
71 * Sets the author.
72 *
73 * @param author
74 * the author to set
75 */
76 public void setAuthor(final String author) {
77 ContractChecker.mustNotBeNull(author, "author");
78 this.author = author;
79 }
80
81 /**
82 * Sets the version.
83 *
84 * @param version
85 * the version to set
86 */
87 public void setVersion(final String version) {
88 ContractChecker.mustNotBeNull(version, "version");
89 this.version = version;
90 }
91
92 /**
93 * @see net.sf.webmancer.base.IApplicationInformation#getTitle()
94 */
95 public String getTitle() {
96 assert this.title != null;
97 return this.title;
98 }
99
100 /**
101 * @see net.sf.webmancer.base.IApplicationInformation#getVersion()
102 */
103 public String getVersion() {
104 assert this.version != null;
105 return this.version;
106 }
107
108 /**
109 * @see net.sf.webmancer.base.IApplicationInformation#getAuthor()
110 */
111 public String getAuthor() {
112 assert this.author != null;
113 return this.author;
114 }
115
116 }