Skip to content

Commit 4aac4d3

Browse files
committed
Clean up javadocs
1 parent 3bea8e9 commit 4aac4d3

2 files changed

Lines changed: 106 additions & 107 deletions

File tree

Menu Library/src/main/java/org/broken/arrow/library/menu/utility/message/BlacklistItemWrapper.java

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
public class BlacklistItemWrapper {
1010
private final PlaceholderTranslator.PlaceholderWrapper placeholderWrapper;
1111
private final ItemStack itemStack;
12-
private final int size;
12+
private final int amount;
1313

1414
/**
1515
* Constructs a new wrapper containing blacklisted items data.
1616
*
1717
* @param itemStack the blacklisted item stack
18-
* @param size the total number of blacklisted items
18+
* @param amount the total number of blacklisted items
1919
*/
20-
public BlacklistItemWrapper(final ItemStack itemStack, final int size) {
20+
public BlacklistItemWrapper(final ItemStack itemStack, final int amount) {
2121
this.placeholderWrapper = new PlaceholderTranslator.PlaceholderWrapper();
2222
this.itemStack = itemStack;
23-
this.size = size;
23+
this.amount = amount;
2424
}
2525

2626
/**
@@ -37,8 +37,8 @@ public ItemStack getItemStack() {
3737
*
3838
* @return duplicated stacks count
3939
*/
40-
public int getSize() {
41-
return size;
40+
public int getAmount() {
41+
return amount;
4242
}
4343

4444

@@ -47,28 +47,26 @@ public int getSize() {
4747
* key-based placeholders instead of using the default indexed placeholder system.
4848
*
4949
* <p>If no custom placeholders are provided, the system falls back to
50-
* {@link #retrieveAsPlaceholderData()}, which uses ordered placeholders such as
51-
* {@code {0}}, {@code {1}}, {@code {2}}.</p>
50+
* {@link #retrieveAsPlaceholderData()}, which uses indexed placeholders such as
51+
* <code>{0}</code>, <code>{1}</code>.</p>
5252
*
53-
* <p>When this wrapper contains entries, it is used instead and allows named
54-
* placeholders.</p>
53+
* <p>When this wrapper contains entries, it overrides the default behavior and
54+
* allows the use of named placeholders.</p>
5555
*
5656
* <p><b>Example (default indexed placeholders):</b></p>
57-
* <pre>
58-
* {@code "&fYou can't add more if this &6 {0} &ftype, you get back &6 {2} &fitems. You have added totally &4 {1} &fextra itemstacks"}
59-
* </pre>
57+
* <pre>{@code
58+
* "&fThis item&6 {0}&f are blacklisted and you get {1} back."
59+
* }</pre>
6060
*
6161
* <p><b>Example (custom named placeholders):</b></p>
62-
* <pre>
63-
* {@code
62+
* <pre>{@code
6463
* wrapper.put("{type}", itemStack.getType())
65-
* .put("{addedStacks}", size)
66-
* .put("{returnedItems}", itemAmount);
67-
* }
68-
* {@code "&fYou can't add more if this &6 {type} &ftype, you get back &6 {returnedItems} &fitems. You have added totally &4 {addedStacks} &fextra itemstacks"}
69-
* </pre>
64+
* .put("{amount}", amount);
7065
*
71-
* @return the {@link PlaceholderTranslator.PlaceholderWrapper} for custom placeholders
66+
* "&fThis item&6 {type}&f are blacklisted and you get {amount} back."
67+
* }</pre>
68+
*
69+
* @return the {@link PlaceholderTranslator.PlaceholderWrapper} used for custom placeholders
7270
*/
7371
public PlaceholderTranslator.PlaceholderWrapper getPlaceholderWrapper() {
7472
return placeholderWrapper;
@@ -81,6 +79,6 @@ public PlaceholderTranslator.PlaceholderWrapper getPlaceholderWrapper() {
8179
* @return an array of placeholder data objects
8280
*/
8381
public Object[] retrieveAsPlaceholderData() {
84-
return new Object[]{itemStack.getType(), size};
82+
return new Object[]{itemStack.getType(), amount};
8583
}
8684
}

Menu Library/src/main/java/org/broken/arrow/library/menu/utility/message/DuplicatedItemWrapper.java

Lines changed: 86 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -4,94 +4,95 @@
44
import org.bukkit.inventory.ItemStack;
55

66
/**
7-
* Wrapper class holding information about duplicated items for placeholder substitution.
8-
*/
9-
public class DuplicatedItemWrapper {
10-
private final PlaceholderTranslator.PlaceholderWrapper placeholderWrapper;
11-
private final ItemStack itemStack;
12-
private final int size;
13-
private final int itemAmount;
7+
* Wrapper class holding information about duplicated items for placeholder substitution.
8+
*/
9+
public class DuplicatedItemWrapper {
10+
private final PlaceholderTranslator.PlaceholderWrapper placeholderWrapper;
11+
private final ItemStack itemStack;
12+
private final int size;
13+
private final int itemAmount;
1414

15-
/**
16-
* Constructs a new wrapper containing duplicated item data.
17-
*
18-
* @param itemStack the duplicated item stack
19-
* @param size the total number of duplicated stacks
20-
* @param itemAmount the total number of duplicated items
21-
*/
22-
public DuplicatedItemWrapper(final ItemStack itemStack, final int size, final int itemAmount) {
23-
this.placeholderWrapper = new PlaceholderTranslator.PlaceholderWrapper();
24-
this.itemStack = itemStack;
25-
this.size = size;
26-
this.itemAmount = itemAmount;
27-
}
15+
/**
16+
* Constructs a new wrapper containing duplicated item data.
17+
*
18+
* @param itemStack the duplicated item stack
19+
* @param size the total number of duplicated stacks
20+
* @param itemAmount the total number of duplicated items
21+
*/
22+
public DuplicatedItemWrapper(final ItemStack itemStack, final int size, final int itemAmount) {
23+
this.placeholderWrapper = new PlaceholderTranslator.PlaceholderWrapper();
24+
this.itemStack = itemStack;
25+
this.size = size;
26+
this.itemAmount = itemAmount;
27+
}
2828

29-
/**
30-
* Returns the duplicated item stack.
31-
*
32-
* @return the item stack
33-
*/
34-
public ItemStack getItemStack() {
35-
return itemStack.clone();
36-
}
29+
/**
30+
* Returns the duplicated item stack.
31+
*
32+
* @return the item stack
33+
*/
34+
public ItemStack getItemStack() {
35+
return itemStack.clone();
36+
}
3737

38-
/**
39-
* Returns the total number of duplicated stacks.
40-
*
41-
* @return duplicated stacks count
42-
*/
43-
public int getSize() {
44-
return size;
45-
}
38+
/**
39+
* Returns the total number of duplicated stacks.
40+
*
41+
* @return duplicated stacks count
42+
*/
43+
public int getSize() {
44+
return size;
45+
}
4646

47-
/**
48-
* Returns the total number of duplicated items.
49-
*
50-
* @return duplicated item count
51-
*/
52-
public int getItemAmount() {
53-
return itemAmount;
54-
}
47+
/**
48+
* Returns the total number of duplicated items.
49+
*
50+
* @return duplicated item count
51+
*/
52+
public int getItemAmount() {
53+
return itemAmount;
54+
}
5555

56-
/**
57-
* Returns a {@link PlaceholderTranslator.PlaceholderWrapper} for defining custom
58-
* key-based placeholders instead of using the default indexed placeholder system.
59-
*
60-
* <p>If no custom placeholders are provided, the system falls back to
61-
* {@link #retrieveAsPlaceholderData()}, which uses ordered placeholders such as
62-
* {@code {0}}, {@code {1}}, {@code {2}}.</p>
63-
*
64-
* <p>When this wrapper contains entries, it is used instead and allows named
65-
* placeholders.</p>
66-
*
67-
* <p><b>Example (default indexed placeholders):</b></p>
68-
* <pre>
69-
* {@code "&fYou can't add more if this &6 {0} &ftype, you get back &6 {2} &fitems. You have added totally &4 {1} &fextra itemstacks"}
70-
* </pre>
71-
*
72-
* <p><b>Example (custom named placeholders):</b></p>
73-
* <pre>
74-
* {@code
75-
* wrapper.put("{type}", itemStack.getType())
76-
* .put("{addedStacks}", size)
77-
* .put("{returnedItems}", itemAmount);
78-
* }
79-
* {@code "&fYou can't add more if this &6 {type} &ftype, you get back &6 {returnedItems} &fitems. You have added totally &4 {addedStacks} &fextra itemstacks"}
80-
* </pre>
81-
*
82-
* @return the {@link PlaceholderTranslator.PlaceholderWrapper} for custom placeholders
83-
*/
84-
public PlaceholderTranslator.PlaceholderWrapper getPlaceholderWrapper() {
85-
return placeholderWrapper;
86-
}
56+
/**
57+
* Returns a {@link PlaceholderTranslator.PlaceholderWrapper} for defining custom
58+
* key-based placeholders instead of using the default indexed placeholder system.
59+
*
60+
* <p>If no custom placeholders are provided, the system falls back to
61+
* {@link #retrieveAsPlaceholderData()}, which uses indexed placeholders such as
62+
* <code>{0}</code>, <code>{1}</code>, <code>{2}</code>.</p>
63+
*
64+
* <p>When this wrapper contains entries, it overrides the default behavior and
65+
* allows the use of named placeholders.</p>
66+
*
67+
* <p><b>Example (default indexed placeholders):</b></p>
68+
* <pre>{@code
69+
* &fYou can't add more of this &6{0}&f type. You get back &6{2}&f items.
70+
* You have added a total of &4{1}&f extra item stacks.
71+
* }</pre>
72+
*
73+
* <p><b>Example (custom named placeholders):</b></p>
74+
* <pre>{@code
75+
* wrapper.put("{type}", itemStack.getType())
76+
* .put("{addedStacks}", size)
77+
* .put("{returnedItems}", itemAmount);
78+
*
79+
* "&fYou can't add more of this &6{type}&f type. You get back &6{returnedItems}&f items.
80+
* You have added a total of &4{addedStacks}&f extra item stacks."
81+
* }</pre>
82+
*
83+
* @return the {@link PlaceholderTranslator.PlaceholderWrapper} used for custom placeholders
84+
*/
85+
public PlaceholderTranslator.PlaceholderWrapper getPlaceholderWrapper() {
86+
return placeholderWrapper;
87+
}
8788

88-
/**
89-
* Returns an array of objects to be used as placeholders in messages:
90-
* item type, duplicated stacks count, and duplicated items count.
91-
*
92-
* @return an array of placeholder data objects
93-
*/
94-
public Object[] retrieveAsPlaceholderData() {
95-
return new Object[]{itemStack.getType(), size, itemAmount};
96-
}
97-
}
89+
/**
90+
* Returns an array of objects to be used as placeholders in messages:
91+
* item type, duplicated stacks count, and duplicated items count.
92+
*
93+
* @return an array of placeholder data objects
94+
*/
95+
public Object[] retrieveAsPlaceholderData() {
96+
return new Object[]{itemStack.getType(), size, itemAmount};
97+
}
98+
}

0 commit comments

Comments
 (0)