Class WbsConfig

java.lang.Object
wbs.utils.util.configuration.WbsConfig

@Beta public class WbsConfig extends Object
Similar to ConfigurationSection, but with support for runtime configuration and class-specific options with an annotation system.

Also serves as a wrapper for ConfigurationSections.

  • Constructor Details

    • WbsConfig

      public WbsConfig(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection wrapped, @NotNull @NotNull WbsSettings settings)
  • Method Details

    • getWrapped

      @NotNull public @NotNull org.bukkit.configuration.ConfigurationSection getWrapped()
    • requireNotNull

      public static void requireNotNull(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section, String field, @Nullable @Nullable WbsSettings settings, @Nullable @Nullable String directory) throws MissingRequiredKeyException
      Check if a config is null, and if it is, log it against the current settings
      Parameters:
      section - The section to check for a key
      field - The key
      settings - The settings to log errors to
      directory - The path to the object being configured
      Throws:
      MissingRequiredKeyException
    • getKeys

      @NotNull public @NotNull Set<String> getKeys(boolean b)
    • getValues

      @NotNull public @NotNull Map<String,Object> getValues(boolean b)
    • contains

      public boolean contains(@NotNull @NotNull String s)
    • contains

      public boolean contains(@NotNull @NotNull String s, boolean b)
    • isSet

      public boolean isSet(@NotNull @NotNull String s)
    • getCurrentPath

      @Nullable public @Nullable String getCurrentPath()
    • getName

      @NotNull public @NotNull String getName()
    • getRoot

      @Nullable public @Nullable org.bukkit.configuration.Configuration getRoot()
    • getParent

      @Nullable public @Nullable org.bukkit.configuration.ConfigurationSection getParent()
    • get

      @Nullable public @Nullable Object get(@NotNull @NotNull String s)
    • get

      @Nullable @Contract("_, !null -> !null") public @Nullable Object get(@NotNull @NotNull String s, @Nullable @Nullable Object o)
    • set

      public void set(@NotNull @NotNull String s, @Nullable @Nullable Object o)
    • createSection

      @NotNull public @NotNull org.bukkit.configuration.ConfigurationSection createSection(@NotNull @NotNull String s)
    • createSection

      @NotNull public @NotNull org.bukkit.configuration.ConfigurationSection createSection(@NotNull @NotNull String s, @NotNull @NotNull Map<?,?> map)
    • getString

      @Nullable public @Nullable String getString(@NotNull @NotNull String s)
    • getString

      @Nullable @Contract("_, !null -> !null") public @Nullable String getString(@NotNull @NotNull String s, @Nullable @Nullable String s1)
    • isString

      public boolean isString(@NotNull @NotNull String s)
    • getInt

      public int getInt(@NotNull @NotNull String s)
    • getInt

      public int getInt(@NotNull @NotNull String s, int i)
    • isInt

      public boolean isInt(@NotNull @NotNull String s)
    • getBoolean

      public boolean getBoolean(@NotNull @NotNull String s)
    • getBoolean

      public boolean getBoolean(@NotNull @NotNull String s, boolean b)
    • isBoolean

      public boolean isBoolean(@NotNull @NotNull String s)
    • getDouble

      public double getDouble(@NotNull @NotNull String s)
    • getDouble

      public double getDouble(@NotNull @NotNull String s, double v)
    • isDouble

      public boolean isDouble(@NotNull @NotNull String s)
    • getLong

      public long getLong(@NotNull @NotNull String s)
    • getLong

      public long getLong(@NotNull @NotNull String s, long l)
    • isLong

      public boolean isLong(@NotNull @NotNull String s)
    • getList

      @Nullable public @Nullable List<?> getList(@NotNull @NotNull String s)
    • getList

      @Nullable @Contract("_, !null -> !null") public @Nullable List<?> getList(@NotNull @NotNull String s, @Nullable @Nullable List<?> list)
    • isList

      public boolean isList(@NotNull @NotNull String s)
    • getStringList

      @NotNull public @NotNull List<String> getStringList(@NotNull @NotNull String s)
    • getIntegerList

      @NotNull public @NotNull List<Integer> getIntegerList(@NotNull @NotNull String s)
    • getBooleanList

      @NotNull public @NotNull List<Boolean> getBooleanList(@NotNull @NotNull String s)
    • getDoubleList

      @NotNull public @NotNull List<Double> getDoubleList(@NotNull @NotNull String s)
    • getFloatList

      @NotNull public @NotNull List<Float> getFloatList(@NotNull @NotNull String s)
    • getLongList

      @NotNull public @NotNull List<Long> getLongList(@NotNull @NotNull String s)
    • getByteList

      @NotNull public @NotNull List<Byte> getByteList(@NotNull @NotNull String s)
    • getCharacterList

      @NotNull public @NotNull List<Character> getCharacterList(@NotNull @NotNull String s)
    • getShortList

      @NotNull public @NotNull List<Short> getShortList(@NotNull @NotNull String s)
    • getMapList

      @NotNull public @NotNull List<Map<?,?>> getMapList(@NotNull @NotNull String s)
    • getObject

      @Nullable public <T> T getObject(@NotNull @NotNull String s, @NotNull @NotNull Class<T> aClass)
    • getObject

      @Nullable @Contract("_, _, !null -> !null") public <T> T getObject(@NotNull @NotNull String s, @NotNull @NotNull Class<T> aClass, @Nullable T t)
    • getSerializable

      @Nullable public <T extends org.bukkit.configuration.serialization.ConfigurationSerializable> T getSerializable(@NotNull @NotNull String s, @NotNull @NotNull Class<T> aClass)
    • getSerializable

      @Nullable @Contract("_, _, !null -> !null") public <T extends org.bukkit.configuration.serialization.ConfigurationSerializable> T getSerializable(@NotNull @NotNull String s, @NotNull @NotNull Class<T> aClass, @Nullable T t)
    • getVector

      @Nullable public @Nullable org.bukkit.util.Vector getVector(@NotNull @NotNull String s)
    • getVector

      @Nullable @Contract("_, !null -> !null") public @Nullable org.bukkit.util.Vector getVector(@NotNull @NotNull String s, @Nullable @Nullable org.bukkit.util.Vector vector)
    • isVector

      public boolean isVector(@NotNull @NotNull String s)
    • getOfflinePlayer

      @Nullable public @Nullable org.bukkit.OfflinePlayer getOfflinePlayer(@NotNull @NotNull String s)
    • getOfflinePlayer

      @Nullable @Contract("_, !null -> !null") public @Nullable org.bukkit.OfflinePlayer getOfflinePlayer(@NotNull @NotNull String s, @Nullable @Nullable org.bukkit.OfflinePlayer offlinePlayer)
    • isOfflinePlayer

      public boolean isOfflinePlayer(@NotNull @NotNull String s)
    • getItemStack

      @Nullable public @Nullable org.bukkit.inventory.ItemStack getItemStack(@NotNull @NotNull String s)
    • getItemStack

      @Nullable @Contract("_, !null -> !null") public @Nullable org.bukkit.inventory.ItemStack getItemStack(@NotNull @NotNull String s, @Nullable @Nullable org.bukkit.inventory.ItemStack itemStack)
    • isItemStack

      public boolean isItemStack(@NotNull @NotNull String s)
    • getColor

      @Nullable public @Nullable org.bukkit.Color getColor(@NotNull @NotNull String s)
    • getColor

      @Nullable @Contract("_, !null -> !null") public @Nullable org.bukkit.Color getColor(@NotNull @NotNull String s, @Nullable @Nullable org.bukkit.Color color)
    • isColor

      public boolean isColor(@NotNull @NotNull String s)
    • getLocation

      @Nullable public @Nullable org.bukkit.Location getLocation(@NotNull @NotNull String s)
    • getLocation

      @Nullable @Contract("_, !null -> !null") public @Nullable org.bukkit.Location getLocation(@NotNull @NotNull String s, @Nullable @Nullable org.bukkit.Location location)
    • isLocation

      public boolean isLocation(@NotNull @NotNull String s)
    • getConfigurationSection

      @Nullable public @Nullable org.bukkit.configuration.ConfigurationSection getConfigurationSection(@NotNull @NotNull String s)
    • isConfigurationSection

      public boolean isConfigurationSection(@NotNull @NotNull String s)
    • getDefaultSection

      @Nullable public @Nullable org.bukkit.configuration.ConfigurationSection getDefaultSection()
    • addDefault

      public void addDefault(@NotNull @NotNull String s, @Nullable @Nullable Object o)