55import fr .maxlego08 .menu .api .loader .ActionLoader ;
66import fr .maxlego08 .menu .api .loader .ButtonLoader ;
77import fr .maxlego08 .menu .api .loader .PermissibleLoader ;
8+ import fr .maxlego08 .menu .api .pattern .ActionPattern ;
89import fr .maxlego08 .menu .api .requirement .Action ;
910import fr .maxlego08 .menu .api .requirement .Permissible ;
1011import fr .maxlego08 .menu .api .requirement .Requirement ;
1112import fr .maxlego08 .menu .api .utils .Loader ;
1213import org .bukkit .configuration .file .YamlConfiguration ;
1314import org .bukkit .plugin .Plugin ;
15+ import org .jetbrains .annotations .NotNull ;
16+ import org .jetbrains .annotations .Nullable ;
1417
1518import java .io .File ;
1619import java .util .Collection ;
@@ -34,27 +37,28 @@ public interface ButtonManager {
3437 *
3538 * @param button The {@link ButtonLoader} instance to register.
3639 */
37- void register (ButtonLoader button );
40+ void register (@ NotNull ButtonLoader button );
3841
3942 /**
4043 * Unregisters an existing {@link ButtonLoader}, ceasing its button creation responsibilities.
4144 *
4245 * @param button The {@link ButtonLoader} instance to unregister.
4346 */
44- void unregister (ButtonLoader button );
47+ void unregister (@ NotNull ButtonLoader button );
4548
4649 /**
4750 * Unregisters all {@link ButtonLoader} instances linked to a specific plugin.
4851 *
4952 * @param plugin The plugin whose loaders should be unregistered.
5053 */
51- void unregisters (Plugin plugin );
54+ void unregisters (@ NotNull Plugin plugin );
5255
5356 /**
5457 * Retrieves all registered {@link ButtonLoader} instances.
5558 *
5659 * @return A collection containing all registered {@link ButtonLoader} instances.
5760 */
61+ @ NotNull
5862 Collection <ButtonLoader > getLoaders ();
5963
6064 /**
@@ -63,28 +67,31 @@ public interface ButtonManager {
6367 * @param plugin The plugin whose loaders are to be retrieved.
6468 * @return A collection of {@link ButtonLoader} instances or an empty collection if none are found.
6569 */
66- Collection <ButtonLoader > getLoaders (Plugin plugin );
70+ @ NotNull
71+ Collection <ButtonLoader > getLoaders (@ NotNull Plugin plugin );
6772
6873 /**
6974 * Retrieves a {@link ButtonLoader} based on the name of the associated {@link Button}.
7075 *
7176 * @param name The name of the {@link ButtonLoader}.
7277 * @return An {@link Optional} containing the {@link ButtonLoader}, if found.
7378 */
74- Optional <ButtonLoader > getLoader (String name );
79+ @ NotNull
80+ Optional <ButtonLoader > getLoader (@ Nullable String name );
7581
7682 /**
7783 * Registers a new {@link PermissibleLoader} responsible for permissible creation.
7884 *
7985 * @param permissibleLoader The {@link PermissibleLoader} instance to register.
8086 */
81- void registerPermissible (PermissibleLoader permissibleLoader );
87+ void registerPermissible (@ NotNull PermissibleLoader permissibleLoader );
8288
8389 /**
8490 * Retrieves a mapping of permissible keys to their associated {@link PermissibleLoader} instances.
8591 *
8692 * @return A map linking permissible keys to their corresponding {@link PermissibleLoader} instances.
8793 */
94+ @ NotNull
8895 Map <String , PermissibleLoader > getPermissibles ();
8996
9097 /**
@@ -93,22 +100,24 @@ public interface ButtonManager {
93100 * @param key The key identifying the permissible.
94101 * @return An {@link Optional} containing the {@link PermissibleLoader}, if found.
95102 */
96- Optional <PermissibleLoader > getPermission (String key );
103+ @ NotNull
104+ Optional <PermissibleLoader > getPermission (@ NotNull String key );
97105
98106 /**
99107 * Registers a new {@link ActionLoader} responsible for action creation.
100108 *
101109 * @param actionLoader The {@link ActionLoader} instance to register.
102110 */
103- void registerAction (ActionLoader actionLoader );
111+ void registerAction (@ NotNull ActionLoader actionLoader );
104112
105113 /**
106114 * Retrieves an {@link Optional} {@link ActionLoader} based on a specific action key.
107115 *
108116 * @param key The key identifying the action.
109117 * @return An {@link Optional} containing the {@link ActionLoader}, if found.
110118 */
111- Optional <ActionLoader > getActionLoader (String key );
119+ @ NotNull
120+ Optional <ActionLoader > getActionLoader (@ NotNull String key );
112121
113122 /**
114123 * Converts a list of map elements from a configuration file into a list of {@link Permissible} objects.
@@ -118,7 +127,8 @@ public interface ButtonManager {
118127 * @param file The configuration file in use.
119128 * @return A list of {@link Permissible} objects derived from the configuration.
120129 */
121- List <Permissible > loadPermissible (List <Map <String , Object >> elements , String path , File file );
130+ @ NotNull
131+ List <@ NotNull Permissible > loadPermissible (@ NotNull List <@ NotNull Map <String , Object >> elements ,@ NotNull String path ,@ NotNull File file );
122132
123133 /**
124134 * Converts a list of map elements from a configuration file into a list of {@link Permissible} objects.
@@ -128,7 +138,8 @@ public interface ButtonManager {
128138 * @param file The file where the configuration is located.
129139 * @return A list of {@link Permissible} objects derived from the configuration.
130140 */
131- List <Permissible > loadPermissible (YamlConfiguration configuration , String path , File file );
141+ @ NotNull
142+ List <@ NotNull Permissible > loadPermissible (@ NotNull YamlConfiguration configuration ,@ NotNull String path ,@ NotNull File file );
132143
133144 /**
134145 * Converts a list of map elements from a configuration file into a list of {@link Action} objects.
@@ -140,7 +151,11 @@ public interface ButtonManager {
140151 * @param file The configuration file in use.
141152 * @return A list of {@link Action} objects derived from the configuration.
142153 */
143- List <Action > loadActions (List <Map <String , Object >> elements , String path , File file );
154+ @ NotNull
155+ List <@ NotNull Action > loadActions (@ NotNull List <@ NotNull Map <String , Object >> elements ,@ NotNull String path ,@ NotNull File file );
156+
157+ @ NotNull
158+ List <@ NotNull Action > loadActions (@ NotNull List <Map <String , Object >> elements ,@ NotNull String path ,@ NotNull File file , @ NotNull List <@ NotNull ActionPattern > defaultActions , boolean useSuccess , boolean stopOnEmpty );
144159
145160 /**
146161 * Converts a list of map elements from a configuration file into a list of {@link Action} objects.
@@ -152,11 +167,17 @@ public interface ButtonManager {
152167 * @param file The configuration file in use.
153168 * @return A list of {@link Action} objects derived from the configuration.
154169 */
155- List <Action > loadActions (YamlConfiguration configuration , String path , File file );
170+ @ NotNull
171+ List <@ NotNull Action > loadActions (@ NotNull YamlConfiguration configuration ,@ NotNull String path ,@ NotNull File file );
172+
173+ @ NotNull
174+ List <@ NotNull Action > loadActions (@ NotNull YamlConfiguration configuration ,@ NotNull String path ,@ NotNull File file , @ NotNull List <@ NotNull ActionPattern > defaultActions , boolean useSuccess , boolean stopOnEmpty );
156175
157- List <Requirement > loadRequirements (YamlConfiguration configuration , String path , File file ) throws InventoryException ;
176+ @ NotNull
177+ List <Requirement > loadRequirements (@ Nullable YamlConfiguration configuration ,@ NotNull String path ,@ NotNull File file ) throws InventoryException ;
158178
159- Requirement loadRequirement (YamlConfiguration configuration , String path , File file ) throws InventoryException ;
179+ @ NotNull
180+ Requirement loadRequirement (@ NotNull YamlConfiguration configuration ,@ NotNull String path ,@ NotNull File file ) throws InventoryException ;
160181
161182 /**
162183 * Retrieves a list of all empty actions from the given configuration elements.
@@ -167,7 +188,8 @@ public interface ButtonManager {
167188 * @param elements The list of configuration items detailing an action's entire configuration.
168189 * @return A list of all empty actions from the given configuration elements.
169190 */
170- List <String > getEmptyActions (List <Map <String , Object >> elements );
191+ @ NotNull
192+ List <String > getEmptyActions (@ NotNull List <Map <String , Object >> elements );
171193
172194 /**
173195 * Retrieves a list of all empty permissibles from the given configuration elements.
@@ -178,18 +200,20 @@ public interface ButtonManager {
178200 * @param elements The list of configuration items detailing a permissible's entire configuration.
179201 * @return A list of all empty permissibles from the given configuration elements.
180202 */
181- List <String > getEmptyPermissible (List <Map <String , Object >> elements );
203+ @ NotNull
204+ List <String > getEmptyPermissible (@ NotNull List <Map <String , Object >> elements );
182205
183206 /**
184207 * Retrieves a {@link Loader} for a {@link Button} object based on the given parameters.
185208 *
186209 * <p>This method is used to create a loader for a button object, given the plugin instance, file, size, and matrix.</p>
187210 *
188211 * @param menuPlugin The plugin instance associated with the button loader.
189- * @param file The file from which the button configuration is loaded.
190- * @param size The size of the button.
191- * @param matrix The matrix containing the button's configuration data.
212+ * @param file The file from which the button configuration is loaded.
213+ * @param size The size of the button.
214+ * @param matrix The matrix containing the button's configuration data.
192215 * @return A {@link Loader} for a {@link Button} object based on the given parameters.
193216 */
194- Loader <Button > getLoaderButton (MenuPlugin menuPlugin , File file , int size , Map <Character , List <Integer >> matrix );
217+ @ NotNull
218+ Loader <Button > getLoaderButton (@ NotNull MenuPlugin menuPlugin ,@ NotNull File file , int size ,@ NotNull Map <Character ,@ NotNull List <Integer >> matrix );
195219}
0 commit comments