2 * jSite2 - ConfigData.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.fcp;
23 * A “ConfigData” message contains various aspects of the node’s configuration.
26 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
28 public class ConfigData extends BaseMessage {
31 * Creates a new “ConfigData” message that wraps the received message.
33 * @param receivedMessage
34 * The received message
36 ConfigData(FcpMessage receivedMessage) {
37 super(receivedMessage);
41 * Returns the current value of the given option.
44 * The name of the option
45 * @return The current value of the option
47 public String getCurrent(String option) {
48 return getField("current." + option);
52 * Returns the short description of the given option.
55 * The name of the option
56 * @return The short description of the option
58 public String getShortDescription(String option) {
59 return getField("shortDescription." + option);
63 * Returns the long description of the given option.
66 * The name of the option
67 * @return The long description of the option
69 public String getLongDescription(String option) {
70 return getField("longDescription." + option);
74 * Returns the data type of the given option.
77 * The name of the option
78 * @return The data type of the option
80 public String getDataType(String option) {
81 return getField("dataType." + option);
85 * Returns the default value of the given option.
88 * The name of the option
89 * @return The default value of the option
91 public String getDefault(String option) {
92 return getField("default." + option);
96 * Returns the sort order of the given option.
99 * The name of the option
100 * @return The sort order of the option, or <code>-1</code> if the sort
101 * order could not be parsed
103 public int getSortOrder(String option) {
104 return FcpUtils.safeParseInt(getField("sortOrder." + option));
108 * Returns the expert flag of the given option.
111 * The name of the option
112 * @return The expert flag of the option
114 public boolean getExpertFlag(String option) {
115 return Boolean.valueOf(getField("expertFlag." + option));
119 * Returns the force-write flag of the given option
122 * The name of the option
123 * @return The force-write flag of the given option
125 public boolean getForceWriteFlag(String option) {
126 return Boolean.valueOf(getField("forceWriteFlag." + option));