Skip to content

Commit c825bb7

Browse files
committed
Cleanup and Javadoc
1 parent 94b2ffc commit c825bb7

File tree

9 files changed

+74
-51
lines changed

9 files changed

+74
-51
lines changed

src/main/java/org/maxgamer/quickshop/chat/QuickChat.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ void sendItemHologramChat(
5858
@NotNull String text,
5959
@NotNull ItemStack itemStack);
6060

61+
/**
62+
* Generate the chat component with preview item hover event
63+
* @param shop The shop
64+
* @param itemStack The itemstack
65+
* @param player The player
66+
* @param message The message with hover event
67+
* @return The component
68+
*/
6169
@NotNull QuickComponent getItemHologramChat(@NotNull Shop shop, @NotNull ItemStack itemStack, @NotNull Player player, @NotNull String message);
6270

6371
/**
@@ -85,7 +93,8 @@ void sendItemHologramChat(
8593
*
8694
* @param receiver The PLAYER will receive this message
8795
* @param message The text will sent
88-
* @param command The command when click to be suggest
96+
* @param command The command when click to be suggested
97+
* @param hoverText The text while player hover on the text
8998
*/
9099
void sendSuggestedChat(@NotNull CommandSender receiver, @NotNull String message, @NotNull String hoverText, @NotNull String command);
91100

src/main/java/org/maxgamer/quickshop/database/DatabaseTask.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,23 @@ public void run(@NonNull Connection connection) {
5757
}
5858

5959
interface Task {
60+
/**
61+
* Edit action before commit the PreparedStatement
62+
* @param ps The PreparedStatement
63+
* @throws SQLException Throws if any exception throws
64+
*/
6065
void edit(PreparedStatement ps) throws SQLException;
6166

67+
/**
68+
* Calling when PreparedStatement finished without any errors
69+
*/
6270
default void onSuccess() {
6371
}
6472

73+
/**
74+
* Calling when PreparedStatement failed to commit
75+
* @param e The exception
76+
*/
6577
default void onFailed(SQLException e) {
6678
e.printStackTrace();
6779
}

src/main/java/org/maxgamer/quickshop/event/QSEvent.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
public abstract class QSEvent extends Event {
2929

30-
private static final HandlerList handlers = new HandlerList();
30+
private static final HandlerList HANDLERS = new HandlerList();
3131

3232
public QSEvent() {
3333

@@ -38,15 +38,18 @@ public QSEvent(boolean async) {
3838
}
3939

4040
public static HandlerList getHandlerList() {
41-
return handlers;
41+
return HANDLERS;
4242
}
4343

4444
@NotNull
4545
@Override
4646
public HandlerList getHandlers() {
47-
return handlers;
47+
return HANDLERS;
4848
}
4949

50+
/**
51+
* Fire event on Bukkit event bus
52+
*/
5053
public void callEvent() {
5154
QuickShop.getInstance().getServer().getPluginManager().callEvent(this);
5255
}

src/main/java/org/maxgamer/quickshop/shop/Shop.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public interface Shop {
173173
/**
174174
* Get sign texts on shop's sign.
175175
*
176+
* @param locale The locale to be created for
176177
* @return String arrays represents sign texts:
177178
* Index | Content
178179
* Line 0: Header

src/main/java/org/maxgamer/quickshop/util/language/text/distributions/Distribution.java

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,32 @@
55
import java.util.List;
66

77
public interface Distribution {
8+
/**
9+
* Gets all languages available on Distribution platform
10+
* @return All available languages on Distribution platform
11+
*/
812
@NotNull List<String> getAvailableLanguages();
9-
13+
/**
14+
* Gets all translation files available on Distribution platform
15+
* @return All translation files on Distribution platform
16+
*/
1017
@NotNull List<String> getAvailableFiles();
1118

12-
@NotNull String getFile(String fileCrowdinPath, String crowdinLocale) throws Exception;
13-
14-
@NotNull String getFile(String fileCrowdinPath, String crowdinLocale, boolean forceFlush) throws Exception;
19+
/**
20+
* Gets the file from the Distribution platform
21+
* @param fileDistributionPath The path on the platform
22+
* @param distributionLocale The locale on the platform
23+
* @return The file content
24+
* @throws Exception The exception throws if any errors occurred while getting file
25+
*/
26+
@NotNull String getFile(String fileDistributionPath, String distributionLocale) throws Exception;
27+
/**
28+
* Gets the file from the Distribution platform
29+
* @param fileDistributionPath The path on the platform
30+
* @param distributionLocale The locale on the platform
31+
* @param forceFlush Forces update the file from the platform
32+
* @return The file content
33+
* @throws Exception The exception throws if any errors occurred while getting file
34+
*/
35+
@NotNull String getFile(String fileDistributionPath, String distributionLocale, boolean forceFlush) throws Exception;
1536
}

src/main/java/org/maxgamer/quickshop/util/language/text/postprocessing/PostProcessor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
import org.jetbrains.annotations.Nullable;
66

77
public interface PostProcessor {
8+
/**
9+
* Process the string
10+
* @param text Original string
11+
* @param sender The command sender
12+
* @param args The arguments
13+
* @return The string that processed
14+
*/
815
@NotNull
916
String process(@NotNull String text, @Nullable CommandSender sender, String... args);
1017
}

src/main/java/org/maxgamer/quickshop/util/logger/ShopLogLogger.java

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
package org.maxgamer.quickshop.util.mojangapi;
22

33
public interface MojangApiMirror {
4+
/**
5+
* https://launchermeta.mojang.com
6+
* @return The url root
7+
*/
48
String getLauncherMetaRoot();
5-
9+
/**
10+
* https://resources.download.minecraft.net
11+
* @return The url root
12+
*/
613
String getResourcesDownloadRoot();
7-
14+
/**
15+
* https://libraries.minecraft.net
16+
* @return The url root
17+
*/
818
String getLibrariesRoot();
919
}

src/main/java/org/maxgamer/quickshop/util/reload/Reloadable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
public interface Reloadable {
2626
/**
2727
* Callback for reloading
28-
*
28+
* @throws Exception Throws error if module failed to process reloading
2929
* @return Reloading success
3030
*/
3131
default ReloadResult reloadModule() throws Exception {

0 commit comments

Comments
 (0)