2 * jSite2 - Project.java -
3 * Copyright © 2008 David Roden
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 package net.pterodactylus.jsite.project;
22 import java.beans.PropertyChangeListener;
24 import net.pterodactylus.util.beans.AbstractBean;
27 * Container for project information. A Project is capable of notifying
28 * {@link PropertyChangeListener}s if any of the contained properties change.
30 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
33 public class Project extends AbstractBean {
35 /** Name of the “name” property. */
36 public static final String PROPERTY_NAME = "name";
38 /** Name of the “description” property. */
39 public static final String PROPERTY_DESCRIPTION = "description";
41 /** Name of the “public key” property. */
42 public static final String PROPERTY_PUBLIC_KEY = "publicKey";
44 /** Name of the “private key” property. */
45 public static final String PROPERTY_PRIVATE_KEY = "privateKey";
47 /** Name of the “local path” property. */
48 public static final String PROPERTY_BASE_PATH = "basePath";
50 /** The name of the project. */
53 /** The description of the project. */
54 private String description;
56 /** The public key. */
57 private String publicKey;
59 /** The private key. */
60 private String privateKey;
62 /** The base path of the project. */
63 private String basePath;
70 * Returns the name of the project.
72 * @return The name of the project
74 public String getName() {
79 * Sets the name of the project.
82 * The name of the project
84 public void setName(String name) {
85 String oldName = this.name;
87 fireIfPropertyChanged(PROPERTY_NAME, oldName, name);
91 * Returns the description of the project.
93 * @return The description of the project
95 public String getDescription() {
100 * Sets the description of the project
103 * The description of the project
105 public void setDescription(String description) {
106 String oldDescription = this.description;
107 this.description = description;
108 fireIfPropertyChanged(PROPERTY_DESCRIPTION, oldDescription, description);
112 * Returns the public key of the project.
114 * @return The public key of the project
116 public String getPublicKey() {
121 * Sets the public key of the project.
124 * The public key of the project
126 public void setPublicKey(String publicKey) {
127 String oldPublicKey = this.publicKey;
128 this.publicKey = publicKey;
129 fireIfPropertyChanged(PROPERTY_PUBLIC_KEY, oldPublicKey, publicKey);
133 * Returns the private key of the project.
135 * @return The private key of the project
137 public String getPrivateKey() {
142 * Sets the private key of the project.
145 * The private key of the project
147 public void setPrivateKey(String privateKey) {
148 String oldPrivateKey = this.privateKey;
149 this.privateKey = privateKey;
150 fireIfPropertyChanged(PROPERTY_PRIVATE_KEY, oldPrivateKey, privateKey);
154 * Returns the base path of the project.
156 * @return The base path of the project
158 public String getBasePath() {
163 * Sets the base path of the project.
166 * The base path of the project
168 public void setBasePath(String basePath) {
169 String oldBasePath = this.basePath;
170 this.basePath = basePath;
171 fireIfPropertyChanged(PROPERTY_BASE_PATH, oldBasePath, basePath);