Skip to content

Commit ebf3673

Browse files
authored
Added missing Javadoc to DiscordClientAction (#613)
1 parent 5fb7119 commit ebf3673

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

application/src/main/java/org/togetherjava/tjbot/commands/utils/DiscordClientAction.java

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import java.util.regex.Pattern;
88

99
/**
10-
* Class which contains all actions a Discord client accepts.
10+
* Class, which contains all actions a Discord client accepts.
1111
* <p>
1212
* This allows you to open DM's {@link Channels#DM_CHANNEL}, specific settings
1313
* {@link Settings.App#VOICE} and much more.
@@ -23,25 +23,25 @@
2323
* Example:
2424
*
2525
* <pre>
26-
* <code>
26+
* {@code
2727
* event.reply("Open Discord's secret home page!")
2828
* .addActionRow(DiscordClientAction.Guild.GUILD_HOME_CHANNEL.asLinkButton("Open home page!", event.getGuild().getId())
29-
* </code>
29+
* }
3030
* </pre>
3131
*
3232
* To improve readability, one might want to use a static import like:
3333
*
3434
* <pre>
35-
* <code>
35+
* {@code
3636
* event.reply(whoIsCommandOutput)
3737
* .addActionRow(USER.asLinkButton("Open home page!", target.getId())
38-
* </code>
38+
* }
3939
* </pre>
4040
*/
4141
public final class DiscordClientAction {
4242

4343
/**
44-
* Contains some of the more general actions
44+
* Contains some of the more general actions.
4545
*/
4646
public enum General {
4747
;
@@ -65,7 +65,7 @@ public enum General {
6565
}
6666

6767
/**
68-
* Contains guild specific actions
68+
* Contains actions related to guilds.
6969
*/
7070
public enum Guild {
7171
;
@@ -94,7 +94,7 @@ public enum Guild {
9494
}
9595

9696
/**
97-
* Contains actions related to channels
97+
* Contains actions related to channels.
9898
*/
9999
public enum Channels {
100100
;
@@ -110,7 +110,7 @@ public enum Channels {
110110
}
111111

112112
/**
113-
* Contains actions related to the settings menu
113+
* Contains actions related to the settings menu.
114114
*/
115115
/*
116116
* The warning is about this inner class being too long, and that it should be external This
@@ -122,7 +122,7 @@ public enum Settings {
122122
;
123123

124124
/**
125-
* Contains all user settings
125+
* Contains all user settings.
126126
*/
127127
public enum User {
128128
;
@@ -140,7 +140,7 @@ public enum User {
140140
}
141141

142142
/**
143-
* Contains all payment settings
143+
* Contains all payment settings.
144144
*/
145145
public enum Payment {
146146
;
@@ -156,7 +156,7 @@ public enum Payment {
156156
}
157157

158158
/**
159-
* Contains all app settings
159+
* Contains all app settings.
160160
*/
161161
public enum App {
162162
;
@@ -195,7 +195,7 @@ public enum App {
195195
}
196196

197197
/**
198-
* Contains some of the more general settings
198+
* Contains some of the more general settings.
199199
*/
200200
public enum General {
201201
;
@@ -211,6 +211,9 @@ public enum General {
211211
}
212212
}
213213

214+
/**
215+
* Contains actions related to game libraries.
216+
*/
214217
public enum Library {
215218
;
216219

@@ -227,15 +230,15 @@ public enum Library {
227230
}
228231

229232
/**
230-
* Pattern for the arguments, finds everything within brackets
233+
* Pattern for the arguments, finds everything within brackets.
231234
*/
232235
public static final Pattern argumentPattern = Pattern.compile("\\{[^}]*}");
233236

234-
private final String url;
237+
private final String rawUrl;
235238

236239
@Contract(pure = true)
237240
private DiscordClientAction(final String url) {
238-
this.url = url;
241+
rawUrl = url;
239242
}
240243

241244
/**
@@ -249,7 +252,7 @@ private DiscordClientAction(final String url) {
249252
* @see #formatUrl(String...)
250253
*/
251254
public String getRawUrl() {
252-
return url;
255+
return rawUrl;
253256
}
254257

255258
/**
@@ -260,7 +263,7 @@ public String getRawUrl() {
260263
* @throws IllegalArgumentException When missing arguments
261264
*/
262265
public String formatUrl(final String... arguments) {
263-
String localUrl = url;
266+
String localUrl = rawUrl;
264267

265268
for (final String argument : arguments) {
266269
localUrl = argumentPattern.matcher(localUrl).replaceFirst(argument);
@@ -288,6 +291,6 @@ public Button asLinkButton(final String label, final String... arguments) {
288291

289292
@Override
290293
public String toString() {
291-
return "DiscordClientAction{" + "url='" + url + '\'' + '}';
294+
return "DiscordClientAction{" + "url='" + rawUrl + '\'' + '}';
292295
}
293296
}

0 commit comments

Comments
 (0)