Update license to GPLv3, fix header comments
[jFCPlib.git] / src / main / java / net / pterodactylus / fcp / GetConfig.java
1 /*
2  * jFCPlib - GetConfig.java - Copyright © 2008–2016 David Roden
3  *
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 3 of the License, or
7  * (at your option) any later version.
8  *
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.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 package net.pterodactylus.fcp;
19
20 /**
21  * The “GetConfig” command tells the node to send its configuration to the
22  * client.
23  *
24  * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
25  */
26 public class GetConfig extends FcpMessage {
27
28         /**
29          * Creates a new “GetConfig” command.
30          */
31         public GetConfig() {
32                 super("GetConfig");
33         }
34
35         public GetConfig(String identifer) {
36                 this();
37                 setField("Identifier", identifer);
38         }
39
40         /**
41          * Sets whether the {@link ConfigData} result message shall include the
42          * current values.
43          *
44          * @param withCurrent
45          *            <code>true</code> to include current values in the result,
46          *            <code>false</code> otherwise
47          */
48         public void setWithCurrent(boolean withCurrent) {
49                 setField("WithCurrent", String.valueOf(withCurrent));
50         }
51
52         /**
53          * Sets whether the {@link ConfigData} result message shall include the
54          * short descriptions.
55          *
56          * @param withShortDescription
57          *            <code>true</code> to include the short descriptions in the
58          *            result, <code>false</code> otherwise
59          */
60         public void setWithShortDescription(boolean withShortDescription) {
61                 setField("WithShortDescription", String.valueOf(withShortDescription));
62         }
63
64         /**
65          * Sets whether the {@link ConfigData} result message shall include the
66          * long descriptions.
67          *
68          * @param withLongDescription
69          *            <code>true</code> to include the long descriptions in the
70          *            result, <code>false</code> otherwise
71          */
72         public void setWithLongDescription(boolean withLongDescription) {
73                 setField("WithLongDescription", String.valueOf(withLongDescription));
74         }
75
76         /**
77          * Sets whether the {@link ConfigData} result message shall include the
78          * data types.
79          *
80          * @param withDataTypes
81          *            <code>true</code> to include the data types in the result,
82          *            <code>false</code> otherwise
83          */
84         public void setWithDataTypes(boolean withDataTypes) {
85                 setField("WithDataTypes", String.valueOf(withDataTypes));
86         }
87
88         /**
89          * Sets whether the {@link ConfigData} result message shall include the
90          * defaults.
91          *
92          * @param setWithDefaults
93          *            <code>true</code> to include the defaults in the result,
94          *            <code>false</code> otherwise
95          */
96         public void setWithDefaults(boolean setWithDefaults) {
97                 setField("WithDefaults", String.valueOf(setWithDefaults));
98         }
99
100         /**
101          * Sets whether the {@link ConfigData} result message shall include the
102          * sort order.
103          *
104          * @param withSortOrder
105          *            <code>true</code> to include the sort order in the result,
106          *            <code>false</code> otherwise
107          */
108         public void setWithSortOrder(boolean withSortOrder) {
109                 setField("WithSortOrder", String.valueOf(withSortOrder));
110         }
111
112         /**
113          * Sets whether the {@link ConfigData} result message shall include the
114          * expert flag.
115          *
116          * @param withExpertFlag
117          *            <code>true</code> to include the expert flag in the result,
118          *            <code>false</code> otherwise
119          */
120         public void setWithExpertFlag(boolean withExpertFlag) {
121                 setField("WithExpertFlag", String.valueOf(withExpertFlag));
122         }
123
124         /**
125          * Sets whether the {@link ConfigData} result message shall include the
126          * force-write flag.
127          *
128          * @param withForceWriteFlag
129          *            <code>true</code> to include the force-write flag in the
130          *            result, <code>false</code> otherwise
131          */
132         public void setWithForceWriteFlag(boolean withForceWriteFlag) {
133                 setField("WithForceWriteFlag", String.valueOf(withForceWriteFlag));
134         }
135
136 }