Class DataOptions

java.lang.Object
xyz.srnyx.javautilities.parents.Stringable
xyz.srnyx.annoyingapi.options.DataOptions

public class DataOptions extends xyz.srnyx.javautilities.parents.Stringable
These options all relate to SQL data management utilities such as StringData and EntityData
  • Field Details

    • enabled

      public boolean enabled
      Whether to enable data management
      You need to enable this if you're using StringData or EntityData!
    • tables

      @NotNull public @NotNull Map<String,Set<String>> tables
      A set of all tables/columns to be created for DataManager. Do not include the table prefix!
      This is case-insensitive, so all keys and values will be converted to lowercase
      All tables will be made with the primary key target
      If no custom columns are added to EntityData.TABLE_NAME, it won't be created. Manually removing it will break EntityData
    • useCacheDefault

      public boolean useCacheDefault
      Whether to use the cache by default for StringData
    • entities

      @NotNull public @NotNull DataOptions.Entities entities
  • Constructor Details

    • DataOptions

      public DataOptions()
      Constructs a new DataOptions instance with default values
  • Method Details

    • enabled

      @NotNull public @NotNull DataOptions enabled(boolean enabled)
      Sets enabled
      Parameters:
      enabled - the new value
      Returns:
      this DataOptions instance for chaining
    • tables

      @NotNull public @NotNull DataOptions tables(@NotNull @NotNull Map<String,Collection<String>> tables)
      Adds all the specified tables to tables
      All tables and columns will be converted to lowercase
      Parameters:
      tables - the tables to add
      Returns:
      this DataOptions instance for chaining
    • table

      @NotNull public @NotNull DataOptions table(@NotNull @NotNull String table, @NotNull @NotNull Collection<String> columns)
      Adds the specified table to tables
      The table and all columns will be converted to lowercase
      Parameters:
      table - the table to add
      columns - the columns to add for the table
      Returns:
      this DataOptions instance for chaining
    • table

      @NotNull public @NotNull DataOptions table(@NotNull @NotNull String table, @NotNull @NotNull String... columns)
      Adds the specified table to tables
      The table and all columns will be converted to lowercase
      Parameters:
      table - the table to add
      columns - the columns to add for the table
      Returns:
      this DataOptions instance for chaining
    • entityDataColumns

      @NotNull public @NotNull DataOptions entityDataColumns(@NotNull @NotNull Collection<String> columns)
      Adds the specified columns to the EntityData.TABLE_NAME table
      Parameters:
      columns - the columns to add
      Returns:
      this DataOptions instance for chaining
    • entityDataColumns

      @NotNull public @NotNull DataOptions entityDataColumns(@NotNull @NotNull String... columns)
      Adds the specified columns to the EntityData.TABLE_NAME table
      Parameters:
      columns - the columns to add
      Returns:
      this DataOptions instance for chaining
    • useCacheDefault

      @NotNull public @NotNull DataOptions useCacheDefault(boolean useCacheDefault)
      Parameters:
      useCacheDefault - the new value
      Returns:
      this DataOptions instance for chaining
    • entities

      @NotNull public @NotNull DataOptions entities(@NotNull @NotNull DataOptions.Entities entities)
      Parameters:
      entities - the new value
      Returns:
      this DataOptions instance for chaining
    • entities

      @NotNull public @NotNull DataOptions entities(@NotNull @NotNull Consumer<DataOptions.Entities> consumer)
      Sets entities using the specified Consumer
      Parameters:
      consumer - the consumer to accept the DataOptions.Entities instance
      Returns:
      this DataOptions instance for chaining
    • load

      @NotNull public static @NotNull DataOptions load(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section)
      Loads the options from the specified ConfigurationSection
      Parameters:
      section - the section to load the options from
      Returns:
      the loaded options