public class DataOptions
extends xyz.srnyx.javautilities.parents.Stringable
StringData and EntityData| Modifier and Type | Class and Description |
|---|---|
static class |
DataOptions.Entities
Options for
entity data management |
| Modifier and Type | Field and Description |
|---|---|
boolean |
enabled
|
@NotNull DataOptions.Entities |
entities
Options for
entity data management |
@NotNull java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
tables
A set of all tables/columns to be created for
DataManager. |
boolean |
useCacheDefault
Whether to use the cache by default for
StringData |
| Constructor and Description |
|---|
DataOptions()
Constructs a new
DataOptions instance with default values |
| Modifier and Type | Method and Description |
|---|---|
@NotNull DataOptions |
enabled(boolean enabled)
Sets
enabled |
@NotNull DataOptions |
entities(@NotNull java.util.function.Consumer<DataOptions.Entities> consumer)
Sets
entities using the specified Consumer |
@NotNull DataOptions |
entities(@NotNull DataOptions.Entities entities)
Sets
entities |
@NotNull DataOptions |
entityDataColumns(@NotNull java.util.Collection<java.lang.String> columns)
Adds the specified columns to the
EntityData.TABLE_NAME table |
@NotNull DataOptions |
entityDataColumns(java.lang.String... columns)
Adds the specified columns to the
EntityData.TABLE_NAME table |
static @NotNull DataOptions |
load(@NotNull org.bukkit.configuration.ConfigurationSection section)
Loads the options from the specified
ConfigurationSection |
@NotNull DataOptions |
table(@NotNull java.lang.String table,
@NotNull java.util.Collection<java.lang.String> columns)
Adds the specified table to
tables
The table and all columns will be converted to lowercase |
@NotNull DataOptions |
table(@NotNull java.lang.String table,
java.lang.String... columns)
Adds the specified table to
tables
The table and all columns will be converted to lowercase |
@NotNull DataOptions |
tables(@NotNull java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> tables)
Adds all the specified tables to
tables
All tables and columns will be converted to lowercase |
@NotNull DataOptions |
useCacheDefault(boolean useCacheDefault)
Sets
useCacheDefault |
public boolean enabled
@NotNull public @NotNull java.util.Map<java.lang.String,java.util.Set<java.lang.String>> tables
DataManager. Do not include the table prefix!
target
EntityData.TABLE_NAME will break EntityDatapublic boolean useCacheDefault
StringData@NotNull public @NotNull DataOptions.Entities entities
entity data managementpublic DataOptions()
DataOptions instance with default values@NotNull public @NotNull DataOptions enabled(boolean enabled)
enabledenabled - the new valueDataOptions instance for chaining@NotNull public @NotNull DataOptions tables(@NotNull @NotNull java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> tables)
tables
tables - the tables to addDataOptions instance for chaining@NotNull public @NotNull DataOptions table(@NotNull @NotNull java.lang.String table, @NotNull @NotNull java.util.Collection<java.lang.String> columns)
tables
table - the table to addcolumns - the columns to add for the tableDataOptions instance for chaining@NotNull public @NotNull DataOptions table(@NotNull @NotNull java.lang.String table, @NotNull java.lang.String... columns)
tables
table - the table to addcolumns - the columns to add for the tableDataOptions instance for chaining@NotNull public @NotNull DataOptions entityDataColumns(@NotNull @NotNull java.util.Collection<java.lang.String> columns)
EntityData.TABLE_NAME tablecolumns - the columns to addDataOptions instance for chaining@NotNull public @NotNull DataOptions entityDataColumns(@NotNull java.lang.String... columns)
EntityData.TABLE_NAME tablecolumns - the columns to addDataOptions instance for chaining@NotNull public @NotNull DataOptions useCacheDefault(boolean useCacheDefault)
useCacheDefaultuseCacheDefault - the new valueDataOptions instance for chaining@NotNull public @NotNull DataOptions entities(@NotNull @NotNull DataOptions.Entities entities)
entitiesentities - the new valueDataOptions instance for chaining@NotNull public @NotNull DataOptions entities(@NotNull @NotNull java.util.function.Consumer<DataOptions.Entities> consumer)
entities using the specified Consumerconsumer - the consumer to accept the DataOptions.Entities instanceDataOptions instance for chaining@NotNull public static @NotNull DataOptions load(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section)
ConfigurationSectionsection - the section to load the options from