Package wbs.utils.util.configuration
Class WbsConfig
java.lang.Object
wbs.utils.util.configuration.WbsConfig
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 Summary
ConstructorsConstructorDescriptionWbsConfig(@NotNull org.bukkit.configuration.ConfigurationSection wrapped, @NotNull WbsSettings settings) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDefault(@NotNull String s, @Nullable Object o) booleanboolean@NotNull org.bukkit.configuration.ConfigurationSectioncreateSection(@NotNull String s) @NotNull org.bukkit.configuration.ConfigurationSectioncreateSection(@NotNull String s, @NotNull Map<?, ?> map) @Nullable Object@Nullable ObjectbooleangetBoolean(@NotNull String s) booleangetBoolean(@NotNull String s, boolean b) getBooleanList(@NotNull String s) getByteList(@NotNull String s) getCharacterList(@NotNull String s) @Nullable org.bukkit.Color@Nullable org.bukkit.Color@Nullable org.bukkit.configuration.ConfigurationSectiongetConfigurationSection(@NotNull String s) @Nullable String@Nullable org.bukkit.configuration.ConfigurationSectiondoubledoublegetDoubleList(@NotNull String s) getFloatList(@NotNull String s) intintgetIntegerList(@NotNull String s) @Nullable org.bukkit.inventory.ItemStackgetItemStack(@NotNull String s) @Nullable org.bukkit.inventory.ItemStackgetItemStack(@NotNull String s, @Nullable org.bukkit.inventory.ItemStack itemStack) getKeys(boolean b) @Nullable List<?>@Nullable List<?>@Nullable org.bukkit.LocationgetLocation(@NotNull String s) @Nullable org.bukkit.LocationgetLocation(@NotNull String s, @Nullable org.bukkit.Location location) longlonggetLongList(@NotNull String s) getMapList(@NotNull String s) @NotNull StringgetName()<T> T<T> T@Nullable org.bukkit.OfflinePlayergetOfflinePlayer(@NotNull String s) @Nullable org.bukkit.OfflinePlayergetOfflinePlayer(@NotNull String s, @Nullable org.bukkit.OfflinePlayer offlinePlayer) @Nullable org.bukkit.configuration.ConfigurationSection@Nullable org.bukkit.configuration.ConfigurationgetRoot()<T extends org.bukkit.configuration.serialization.ConfigurationSerializable>
TgetSerializable(@NotNull String s, @NotNull Class<T> aClass) <T extends org.bukkit.configuration.serialization.ConfigurationSerializable>
TgetSerializable(@NotNull String s, @NotNull Class<T> aClass, T t) getShortList(@NotNull String s) @Nullable String@Nullable StringgetStringList(@NotNull String s) getValues(boolean b) @Nullable org.bukkit.util.Vector@Nullable org.bukkit.util.Vector@NotNull org.bukkit.configuration.ConfigurationSectionbooleanbooleanbooleanisConfigurationSection(@NotNull String s) booleanbooleanbooleanisItemStack(@NotNull String s) booleanbooleanisLocation(@NotNull String s) booleanbooleanisOfflinePlayer(@NotNull String s) booleanbooleanbooleanstatic voidrequireNotNull(@NotNull org.bukkit.configuration.ConfigurationSection section, String field, @Nullable WbsSettings settings, @Nullable String directory) Check if a config is null, and if it is, log it against the current settingsvoid
-
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 keyfield- The keysettings- The settings to log errors todirectory- The path to the object being configured- Throws:
MissingRequiredKeyException
-
getKeys
-
getValues
-
contains
-
contains
-
isSet
-
getCurrentPath
-
getName
-
getRoot
@Nullable public @Nullable org.bukkit.configuration.Configuration getRoot() -
getParent
@Nullable public @Nullable org.bukkit.configuration.ConfigurationSection getParent() -
get
-
get
-
set
-
createSection
@NotNull public @NotNull org.bukkit.configuration.ConfigurationSection createSection(@NotNull @NotNull String s) -
createSection
-
getString
-
getString
-
isString
-
getInt
-
getInt
-
isInt
-
getBoolean
-
getBoolean
-
isBoolean
-
getDouble
-
getDouble
-
isDouble
-
getLong
-
getLong
-
isLong
-
getList
-
getList
-
isList
-
getStringList
-
getIntegerList
-
getBooleanList
-
getDoubleList
-
getFloatList
-
getLongList
-
getByteList
-
getCharacterList
-
getShortList
-
getMapList
-
getObject
-
getObject
-
getSerializable
-
getSerializable
-
getVector
-
getVector
@Nullable @Contract("_, !null -> !null") public @Nullable org.bukkit.util.Vector getVector(@NotNull @NotNull String s, @Nullable @Nullable org.bukkit.util.Vector vector) -
isVector
-
getOfflinePlayer
-
getOfflinePlayer
@Nullable @Contract("_, !null -> !null") public @Nullable org.bukkit.OfflinePlayer getOfflinePlayer(@NotNull @NotNull String s, @Nullable @Nullable org.bukkit.OfflinePlayer offlinePlayer) -
isOfflinePlayer
-
getItemStack
-
getItemStack
@Nullable @Contract("_, !null -> !null") public @Nullable org.bukkit.inventory.ItemStack getItemStack(@NotNull @NotNull String s, @Nullable @Nullable org.bukkit.inventory.ItemStack itemStack) -
isItemStack
-
getColor
-
getColor
@Nullable @Contract("_, !null -> !null") public @Nullable org.bukkit.Color getColor(@NotNull @NotNull String s, @Nullable @Nullable org.bukkit.Color color) -
isColor
-
getLocation
-
getLocation
@Nullable @Contract("_, !null -> !null") public @Nullable org.bukkit.Location getLocation(@NotNull @NotNull String s, @Nullable @Nullable org.bukkit.Location location) -
isLocation
-
getConfigurationSection
@Nullable public @Nullable org.bukkit.configuration.ConfigurationSection getConfigurationSection(@NotNull @NotNull String s) -
isConfigurationSection
-
getDefaultSection
@Nullable public @Nullable org.bukkit.configuration.ConfigurationSection getDefaultSection() -
addDefault
-