Class IDataHandler<P extends CodexPlugin<P>,U extends IAbstractUser<P>>

java.lang.Object
studio.magemonkey.codex.data.IDataHandler<P,U>

public abstract class IDataHandler<P extends CodexPlugin<P>,U extends IAbstractUser<P>> extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • setup

      public final void setup()
    • shutdown

      public final void shutdown()
    • registerAdapters

      @NotNull protected com.google.gson.GsonBuilder registerAdapters(@NotNull com.google.gson.GsonBuilder builder)
    • getConnection

      @NotNull protected final Connection getConnection()
    • createTable

      protected void createTable(@NotNull String table, @NotNull LinkedHashMap<String,String> valMap)
    • renameTable

      protected void renameTable(@NotNull String from, @NotNull String to)
    • hasTable

      protected boolean hasTable(@NotNull String table)
    • addColumn

      protected void addColumn(@NotNull String table, @NotNull String column, @NotNull String type, @NotNull String def)
    • removeColumn

      protected void removeColumn(@NotNull String table, @NotNull String column)
    • hasColumn

      public final boolean hasColumn(@NotNull String table, @NotNull String columnName)
    • addData

      protected void addData(@NotNull String table, @NotNull LinkedHashMap<String,String> keys)
    • saveData

      protected void saveData(@NotNull String table, @NotNull LinkedHashMap<String,String> valMap, @NotNull Map<String,String> whereMap)
    • deleteData

      protected void deleteData(@NotNull String table, @NotNull Map<String,String> whereMap)
    • getData

      @Nullable protected <T> T getData(@NotNull String table, @NotNull Map<String,String> whereMap, @NotNull Function<ResultSet,T> fn)
    • getDatas

      @NotNull protected <T> List<T> getDatas(@NotNull String table, @NotNull Map<String,String> whereMap, @NotNull Function<ResultSet,T> dataFunction, int amount)
    • onTableCreate

      protected void onTableCreate()
    • getColumnsToCreate

      @NotNull protected abstract LinkedHashMap<String,String> getColumnsToCreate()
    • getColumnsToSave

      @NotNull protected abstract LinkedHashMap<String,String> getColumnsToSave(@NotNull U user)
    • getFunctionToUser

      @NotNull protected abstract Function<ResultSet,U> getFunctionToUser()
    • purge

      public void purge()
    • execute

      public final void execute(@NotNull String sql)
    • getUsers

      @NotNull public List<U> getUsers()
    • getUser

      @Nullable public U getUser(@NotNull org.bukkit.entity.Player player)
    • getUser

      @Nullable public U getUser(@NotNull UUID uuid)
    • getUser

      @Nullable public final U getUser(@NotNull String uuid, boolean isId)
    • isUserExists

      public boolean isUserExists(@NotNull String uuid, boolean uid)
    • saveUser

      public void saveUser(@NotNull U user)
    • addUser

      public void addUser(@NotNull U user)
    • deleteUser

      public void deleteUser(@NotNull String uuid)