Package xyz.srnyx.annoyingapi.options
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-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionboolean@NotNull DataOptions.EntitiesOptions forentity data managementA set of all tables/columns to be created forDataManager.booleanWhether to use the cache by default forStringData -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull DataOptionsenabled(boolean enabled) Setsenabled@NotNull DataOptionsentities(@NotNull Consumer<DataOptions.Entities> consumer) @NotNull DataOptionsentities(@NotNull DataOptions.Entities entities) Setsentities@NotNull DataOptionsentityDataColumns(@NotNull String... columns) Adds the specified columns to theEntityData.TABLE_NAMEtable@NotNull DataOptionsentityDataColumns(@NotNull Collection<String> columns) Adds the specified columns to theEntityData.TABLE_NAMEtablestatic @NotNull DataOptionsload(@NotNull org.bukkit.configuration.ConfigurationSection section) Loads the options from the specifiedConfigurationSection@NotNull DataOptionsAdds the specified table totables
The table and all columns will be converted to lowercase@NotNull DataOptionstable(@NotNull String table, @NotNull Collection<String> columns) Adds the specified table totables
The table and all columns will be converted to lowercase@NotNull DataOptionstables(@NotNull Map<String, Collection<String>> tables) Adds all the specified tables totables
All tables and columns will be converted to lowercase@NotNull DataOptionsuseCacheDefault(boolean useCacheDefault) SetsuseCacheDefaultMethods inherited from class xyz.srnyx.javautilities.parents.Stringable
toString, toString, toString, toString, toString
-
Field Details
-
enabled
public boolean enabled -
tables
A set of all tables/columns to be created forDataManager. 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 keytarget
If no custom columns are added toEntityData.TABLE_NAME, it won't be created. Manually removing it will breakEntityData -
useCacheDefault
public boolean useCacheDefaultWhether to use the cache by default forStringData -
entities
Options forentity data management
-
-
Constructor Details
-
DataOptions
public DataOptions()Constructs a newDataOptionsinstance with default values
-
-
Method Details
-
enabled
Setsenabled- Parameters:
enabled- the new value- Returns:
- this
DataOptionsinstance for chaining
-
tables
@NotNull public @NotNull DataOptions tables(@NotNull @NotNull Map<String, Collection<String>> tables) Adds all the specified tables totables
All tables and columns will be converted to lowercase- Parameters:
tables- the tables to add- Returns:
- this
DataOptionsinstance for chaining
-
table
@NotNull public @NotNull DataOptions table(@NotNull @NotNull String table, @NotNull @NotNull Collection<String> columns) Adds the specified table totables
The table and all columns will be converted to lowercase- Parameters:
table- the table to addcolumns- the columns to add for the table- Returns:
- this
DataOptionsinstance for chaining
-
table
@NotNull public @NotNull DataOptions table(@NotNull @NotNull String table, @NotNull @NotNull String... columns) Adds the specified table totables
The table and all columns will be converted to lowercase- Parameters:
table- the table to addcolumns- the columns to add for the table- Returns:
- this
DataOptionsinstance for chaining
-
entityDataColumns
@NotNull public @NotNull DataOptions entityDataColumns(@NotNull @NotNull Collection<String> columns) Adds the specified columns to theEntityData.TABLE_NAMEtable- Parameters:
columns- the columns to add- Returns:
- this
DataOptionsinstance for chaining
-
entityDataColumns
Adds the specified columns to theEntityData.TABLE_NAMEtable- Parameters:
columns- the columns to add- Returns:
- this
DataOptionsinstance for chaining
-
useCacheDefault
SetsuseCacheDefault- Parameters:
useCacheDefault- the new value- Returns:
- this
DataOptionsinstance for chaining
-
entities
Setsentities- Parameters:
entities- the new value- Returns:
- this
DataOptionsinstance for chaining
-
entities
@NotNull public @NotNull DataOptions entities(@NotNull @NotNull Consumer<DataOptions.Entities> consumer) - Parameters:
consumer- the consumer to accept theDataOptions.Entitiesinstance- Returns:
- this
DataOptionsinstance for chaining
-
load
@NotNull public static @NotNull DataOptions 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
-