Class 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 Detail

      • tables

        @NotNull
        public @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. 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
    • Constructor Detail

      • DataOptions

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

      • 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 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
        Parameters:
        tables - the tables to add
        Returns:
        this DataOptions instance for chaining
      • table

        @NotNull
        public @NotNull DataOptions table​(@NotNull
                                          @NotNull java.lang.String table,
                                          @NotNull
                                          @NotNull java.util.Collection<java.lang.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 java.lang.String table,
                                          @NotNull
                                          @NotNull java.lang.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 java.util.Collection<java.lang.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 java.lang.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
      • 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