Package xyz.srnyx.annoyingapi.options
Class RegistrationOptions
- java.lang.Object
-
- xyz.srnyx.javautilities.parents.Stringable
-
- xyz.srnyx.annoyingapi.options.RegistrationOptions
-
public class RegistrationOptions extends xyz.srnyx.javautilities.parents.StringableRepresents the options for class registration (commands/listeners/etc...)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRegistrationOptions.AutomaticRegistrationThe automatic registration options
-
Field Summary
Fields Modifier and Type Field Description @NotNull RegistrationOptions.AutomaticRegistrationautomaticRegistrationTheRegistrationOptions.AutomaticRegistrationoptions to automatically registerRegistrables@NotNull java.util.function.Supplier<java.lang.Object>papiExpansionToRegister@NotNull java.util.Set<Registrable>toRegister
-
Constructor Summary
Constructors Constructor Description RegistrationOptions()Constructs a newRegistrationOptionsinstance with default values
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull RegistrationOptionsautomaticRegistration(@NotNull java.util.function.Consumer<RegistrationOptions.AutomaticRegistration> automaticRegistration)Sets theautomaticRegistrationusing the specifiedConsumer@NotNull RegistrationOptionsautomaticRegistration(@NotNull RegistrationOptions.AutomaticRegistration automaticRegistration)Sets theautomaticRegistration@NotNull java.util.Optional<me.clip.placeholderapi.expansion.PlaceholderExpansion>getPapiExpansionToRegister()Casts thepapiExpansionToRegisterto aPlaceholderExpansionand returns itstatic @NotNull RegistrationOptionsload(@NotNull org.bukkit.configuration.ConfigurationSection section)Loads the options from the specifiedConfigurationSection@NotNull RegistrationOptionspapiExpansionToRegister(@NotNull java.util.function.Supplier<java.lang.Object> papiExpansionToRegister)Sets thepapiExpansionToRegister@NotNull RegistrationOptionstoRegister(@NotNull java.util.Collection<Registrable> toRegister)Adds the specifiedRegistrables totoRegister@NotNull RegistrationOptionstoRegister(@NotNull AnnoyingPlugin plugin, @NotNull java.lang.Class<? extends Registrable>... toRegister)Adds the specifiedRegistrables totoRegister@NotNull RegistrationOptionstoRegister(@NotNull AnnoyingPlugin plugin, @NotNull java.util.Collection<java.lang.Class<? extends Registrable>> toRegister)Adds the specifiedRegistrables totoRegister@NotNull RegistrationOptionstoRegister(@NotNull Registrable... toRegister)Adds the specifiedRegistrables totoRegister
-
-
-
Field Detail
-
automaticRegistration
@NotNull public @NotNull RegistrationOptions.AutomaticRegistration automaticRegistration
TheRegistrationOptions.AutomaticRegistrationoptions to automatically registerRegistrables
-
toRegister
@NotNull public @NotNull java.util.Set<Registrable> toRegister
-
papiExpansionToRegister
@NotNull public @NotNull java.util.function.Supplier<java.lang.Object> papiExpansionToRegister
-
-
Constructor Detail
-
RegistrationOptions
public RegistrationOptions()
Constructs a newRegistrationOptionsinstance with default values
-
-
Method Detail
-
load
@NotNull public static @NotNull RegistrationOptions load(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section)
Loads the options from the specifiedConfigurationSection- Parameters:
section- the section to load the options from- Returns:
- the loaded options
-
getPapiExpansionToRegister
@NotNull public @NotNull java.util.Optional<me.clip.placeholderapi.expansion.PlaceholderExpansion> getPapiExpansionToRegister()
Casts thepapiExpansionToRegisterto aPlaceholderExpansionand returns it- Returns:
- the
papiExpansionToRegisteras aPlaceholderExpansionor empty if it isn't
-
automaticRegistration
@NotNull public @NotNull RegistrationOptions automaticRegistration(@NotNull @NotNull RegistrationOptions.AutomaticRegistration automaticRegistration)
Sets theautomaticRegistration- Parameters:
automaticRegistration- the automatic registration- Returns:
- this
RegistrationOptionsinstance for chaining
-
automaticRegistration
@NotNull public @NotNull RegistrationOptions automaticRegistration(@NotNull @NotNull java.util.function.Consumer<RegistrationOptions.AutomaticRegistration> automaticRegistration)
Sets theautomaticRegistrationusing the specifiedConsumer- Parameters:
automaticRegistration- the automatic registration- Returns:
- this
RegistrationOptionsinstance for chaining
-
toRegister
@NotNull public @NotNull RegistrationOptions toRegister(@NotNull @NotNull java.util.Collection<Registrable> toRegister)
Adds the specifiedRegistrables totoRegister- Parameters:
toRegister- theRegistrables to add- Returns:
- this
RegistrationOptionsinstance for chaining
-
toRegister
@NotNull public @NotNull RegistrationOptions toRegister(@NotNull @NotNull Registrable... toRegister)
Adds the specifiedRegistrables totoRegister- Parameters:
toRegister- theRegistrables to add- Returns:
- this
RegistrationOptionsinstance for chaining
-
toRegister
@NotNull public @NotNull RegistrationOptions toRegister(@NotNull @NotNull AnnoyingPlugin plugin, @NotNull @NotNull java.util.Collection<java.lang.Class<? extends Registrable>> toRegister)
Adds the specifiedRegistrables totoRegister- Parameters:
plugin- the plugin instancetoRegister- theRegistrables to add- Returns:
- this
RegistrationOptionsinstance for chaining
-
toRegister
@NotNull @SafeVarargs public final @NotNull RegistrationOptions toRegister(@NotNull @NotNull AnnoyingPlugin plugin, @NotNull @NotNull java.lang.Class<? extends Registrable>... toRegister)
Adds the specifiedRegistrables totoRegister- Parameters:
plugin- the plugin instancetoRegister- theRegistrables to add- Returns:
- this
RegistrationOptionsinstance for chaining
-
papiExpansionToRegister
@NotNull public @NotNull RegistrationOptions papiExpansionToRegister(@NotNull @NotNull java.util.function.Supplier<java.lang.Object> papiExpansionToRegister)
Sets thepapiExpansionToRegister- Parameters:
papiExpansionToRegister- the PAPI expansion to register- Returns:
- this
RegistrationOptionsinstance for chaining
-
-