Skip to content

Commit 1e7198f

Browse files
committed
Add javadocs to MessageDispatcher
1 parent 7bb7174 commit 1e7198f

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

core/src/main/java/org/mythicprojects/yetanothermessageslibrary/message/MessageDispatcher.java

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,19 @@
1616
import org.mythicprojects.yetanothermessageslibrary.replace.replacement.Replacement;
1717
import org.mythicprojects.yetanothermessageslibrary.util.TriFunction;
1818

19+
/**
20+
* MessageDispatcher is a class that allows you to send messages to receivers with placeholders and actions.
21+
* It highly simplifies the process of sending messages to multiple receivers in multiple languages etc.
22+
*
23+
* @param <RECEIVER> the type of the receiver
24+
* @param <DISPATCHER> the type of the dispatcher itself
25+
*/
1926
@SuppressWarnings("unchecked")
2027
public interface MessageDispatcher<RECEIVER, DISPATCHER extends MessageDispatcher<RECEIVER, ? extends DISPATCHER>> {
2128

2229
/**
2330
* Add a receiver to the dispatcher
31+
*
2432
* @param receiver the receiver
2533
* @return this dispatcher
2634
*/
@@ -29,6 +37,7 @@ public interface MessageDispatcher<RECEIVER, DISPATCHER extends MessageDispatche
2937

3038
/**
3139
* Add multiple receivers to the dispatcher
40+
*
3241
* @param receivers the receivers
3342
* @return this dispatcher
3443
*/
@@ -40,6 +49,7 @@ default DISPATCHER receivers(@NotNull Collection<? extends @Nullable RECEIVER> r
4049

4150
/**
4251
* Add multiple receivers to the dispatcher
52+
*
4353
* @param receivers the receivers
4454
* @return this dispatcher
4555
*/
@@ -53,6 +63,7 @@ default DISPATCHER receivers(@NotNull RECEIVER... receivers) {
5363

5464
/**
5565
* Add all players to the dispatcher
66+
*
5667
* @return this dispatcher
5768
* @throws UnsupportedOperationException if the operation is not implemented in the current MessageDispatcher
5869
*/
@@ -65,6 +76,7 @@ default DISPATCHER all() throws UnsupportedOperationException {
6576

6677
/**
6778
* Add all players to the dispatcher
79+
*
6880
* @return this dispatcher
6981
* @throws UnsupportedOperationException if the operation is not implemented in the current MessageDispatcher
7082
*/
@@ -75,6 +87,7 @@ default DISPATCHER allPlayers() throws UnsupportedOperationException {
7587

7688
/**
7789
* Add all viewers to the dispatcher
90+
*
7891
* @return this dispatcher
7992
* @throws UnsupportedOperationException if the operation is not implemented in the current MessageDispatcher
8093
*/
@@ -85,6 +98,7 @@ default DISPATCHER console() throws UnsupportedOperationException {
8598

8699
/**
87100
* Add a predicate to the dispatcher
101+
*
88102
* @param predicate the predicate
89103
* @return this dispatcher
90104
*/
@@ -93,9 +107,10 @@ default DISPATCHER console() throws UnsupportedOperationException {
93107

94108
/**
95109
* Add a predicate to the dispatcher for a specific receiver class
110+
*
96111
* @param receiverClass the class of the receiver
97-
* @param predicate the predicate
98-
* @param <T> the type of the receiver
112+
* @param predicate the predicate
113+
* @param <T> the type of the receiver
99114
* @return this dispatcher
100115
*/
101116
@Contract("_, _ -> this")
@@ -110,7 +125,8 @@ default <T extends RECEIVER> DISPATCHER predicate(@NotNull Class<T> receiverClas
110125

111126
/**
112127
* Add a field to the dispatcher to use by the replacements
113-
* @param key the key of the field
128+
*
129+
* @param key the key of the field
114130
* @param value the value of the field
115131
* @return this dispatcher
116132
*/
@@ -119,6 +135,7 @@ default <T extends RECEIVER> DISPATCHER predicate(@NotNull Class<T> receiverClas
119135

120136
/**
121137
* Add multiple fields to the dispatcher to use by the replacements
138+
*
122139
* @param fields the fields
123140
* @return this dispatcher
124141
*/
@@ -237,6 +254,7 @@ default <T extends RECEIVER> DISPATCHER with(
237254

238255
/**
239256
* Add an action to the dispatcher that will be executed after the message is sent
257+
*
240258
* @param action the action
241259
* @return this dispatcher
242260
*/
@@ -245,6 +263,7 @@ default <T extends RECEIVER> DISPATCHER with(
245263

246264
/**
247265
* Send the message to all receivers
266+
*
248267
* @return this dispatcher
249268
*/
250269
@Contract(" -> this")

0 commit comments

Comments
 (0)