Interface CategoryRegistry
public interface CategoryRegistry
A class for registry of
Category
.-
Method Summary
Modifier and TypeMethodDescriptionasMap()
Converts thisCategoryRegistry
toMap
.static @NotNull CategoryRegistry
get()
Gets theCategoryRegistry
instance.Gets theCategory
that registered with the specified name.@NotNull Category
Gets theCategory
for custom items.@NotNull String
getRegisteredName
(@NotNull Category category) Gets the name ofCategory
.names()
Gets the list of registered names.void
Registers a newCategory
.void
unregister
(@NotNull String name) Unregisters aCategory
by its registered name.void
unregister
(@NotNull Category category) Unregisters aCategory
.void
Unregisters allCategory
.values()
Gets the list of registeredCategory
.
-
Method Details
-
get
Gets theCategoryRegistry
instance.- Returns:
- the
CategoryRegistry
instance
-
register
Registers a newCategory
. -
unregister
Unregisters aCategory
by its registered name.- Parameters:
name
- the name ofCategory
to unregister
-
unregister
- Parameters:
category
- theCategory
to unregister
-
unregisterAll
void unregisterAll()Unregisters allCategory
. -
getByName
Gets theCategory
that registered with the specified name. -
getRegisteredName
Gets the name ofCategory
.- Parameters:
category
- theCategory
to search for its name- Returns:
- the registered name
- Throws:
IllegalStateException
- if the givenCategory
is not registered to this registry
-
names
Gets the list of registered names.- Returns:
- the list of registered names
-
values
Gets the list of registeredCategory
.- Returns:
- the list of registered
Category
-
asMap
Converts thisCategoryRegistry
toMap
.- Returns:
- the
Map
of this registry
-
getCustomItemCategory
Gets theCategory
for custom items.- Returns:
- the
Category
for custom items
-