Package com.cryptomorin.xseries.base
Class XRegistry<XForm extends XBase<XForm,BukkitForm>,BukkitForm>
java.lang.Object
com.cryptomorin.xseries.base.XRegistry<XForm,BukkitForm>
- Type Parameters:
XForm- The type used within this library.BukkitForm- The corresponding Bukkit type of theXRegistry.
- All Implemented Interfaces:
Iterable<XForm>
@Internal
public final class XRegistry<XForm extends XBase<XForm,BukkitForm>,BukkitForm>
extends Object
implements Iterable<XForm>
A registry similar to Bukkit's
Registry. It holds values as a form of XBase and
allows cross-version name mappings and also direct bukkit-to-xform mappings as well.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionXRegistry(Class<BukkitForm> bukkitFormClass, Class<XForm> xFormClass, Function<Integer, XForm[]> createArray) XRegistry(Class<BukkitForm> bukkitFormClass, Class<XForm> xFormClass, Supplier<Object> registrySupplier, BiFunction<BukkitForm, String[], XForm> creator, Function<Integer, XForm[]> createArray) -
Method Summary
Modifier and TypeMethodDescription@NotNull Map<BukkitForm, XForm> protected BukkitFormstatic @NotNull StringgetBukkitName(@NotNull Object bukkitForm) getByBukkitForm(BukkitForm bukkit) getName()Gets the name of the registry, which is usually the bukkit form's simple class name.@Unmodifiable @NotNull Collection<XForm> iterator()voidregisterName(String name, XForm xForm) std(Function<BukkitForm, XForm> xForm, String[] names) stdEnum(XForm xForm, String[] names, BukkitForm bukkit) toString()XForm[]values()Deprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
XRegistry
@Internal public XRegistry(Class<BukkitForm> bukkitFormClass, Class<XForm> xFormClass, Supplier<Object> registrySupplier, BiFunction<BukkitForm, String[], XForm> creator, Function<Integer, XForm[]> createArray) -
XRegistry
-
-
Method Details
-
nameMapping
-
bukkitMapping
-
getName
Gets the name of the registry, which is usually the bukkit form's simple class name. -
registerName
-
getBukkit
-
getValues
- See Also:
-
values
Deprecated.Use ofvalues()should be discouraged by staticXModuleimplementations, insteadgetValues()should be used.- See Also:
-
iterator
-
getByBukkitForm
-
getByName
-
getBukkitName
-
std
-
stdEnum
-
stdEnum
-
std
-
std
-
std
-
toString
-