2 * jFCPlib - ConfigData.java - Copyright © 2008 David Roden
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 package net.pterodactylus.fcp;
22 * A “ConfigData” message contains various aspects of the node’s configuration.
25 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
27 public class ConfigData extends BaseMessage {
30 * Creates a new “ConfigData” message that wraps the received message.
32 * @param receivedMessage
33 * The received message
35 public ConfigData(FcpMessage receivedMessage) {
36 super(receivedMessage);
40 * Returns the current value of the given option.
43 * The name of the option
44 * @return The current value of the option
46 public String getCurrent(String option) {
47 return getField("current." + option);
51 * Returns the short description of the given option.
54 * The name of the option
55 * @return The short description of the option
57 public String getShortDescription(String option) {
58 return getField("shortDescription." + option);
62 * Returns the long description of the given option.
65 * The name of the option
66 * @return The long description of the option
68 public String getLongDescription(String option) {
69 return getField("longDescription." + option);
73 * Returns the data type of the given option.
76 * The name of the option
77 * @return The data type of the option
79 public String getDataType(String option) {
80 return getField("dataType." + option);
84 * Returns the default value of the given option.
87 * The name of the option
88 * @return The default value of the option
90 public String getDefault(String option) {
91 return getField("default." + option);
95 * Returns the sort order of the given option.
98 * The name of the option
99 * @return The sort order of the option, or <code>-1</code> if the sort
100 * order could not be parsed
102 public int getSortOrder(String option) {
103 return FcpUtils.safeParseInt(getField("sortOrder." + option));
107 * Returns the expert flag of the given option.
110 * The name of the option
111 * @return The expert flag of the option
113 public boolean getExpertFlag(String option) {
114 return Boolean.valueOf(getField("expertFlag." + option));
118 * Returns the force-write flag of the given option
121 * The name of the option
122 * @return The force-write flag of the given option
124 public boolean getForceWriteFlag(String option) {
125 return Boolean.valueOf(getField("forceWriteFlag." + option));