类 Data

java.lang.Object
top.shjibi.plugineer.config.Configurable<Map<UUID,com.google.gson.JsonObject>>
top.shjibi.plugineer.config.Data

public class Data extends Configurable<Map<UUID,com.google.gson.JsonObject>>
代表一种数据
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    protected final Map<UUID,com.google.gson.JsonObject>
     
    protected final File[]
     
    protected final File
     
    protected final String
     
    protected final org.bukkit.plugin.Plugin
     
  • 构造器概要

    构造器
    构造器
    说明
    Data(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull String name)
    建立一个名字为name的数据
    Data(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull String name, @NotNull String folderPath)
    建立一个名字为name的数据
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    addData(@NotNull UUID uuid, @NotNull com.google.gson.JsonObject obj)
    添加键为uuid, 值为obj的数据
    @NotNull Map<UUID,com.google.gson.JsonObject>
     
    @Nullable com.google.gson.JsonObject
    getData(@NotNull UUID uuid)
    获取以uuid为键的数据对应的值
    @NotNull File[]
    获取存储数据的所有文件
    @NotNull File
     
    @NotNull String
     
    @NotNull org.bukkit.plugin.Plugin
    获取使用该数据的文件夹
    protected @NotNull Map<UUID,com.google.gson.JsonObject>
    load(@NotNull File folder)
    从文件中加载数据
    void
    removeData(@Nullable UUID uuid)
    移除键为uuid的数据
    void
    保存内存中所有的数据
    void
    saveData(@NotNull UUID uuid)
    保存键为uuid的数据
    @Nullable com.google.gson.JsonObject
    setData(@NotNull UUID uuid, @NotNull com.google.gson.JsonObject obj)
    将键为uuid的数据的值设置为obj

    从类继承的方法 top.shjibi.plugineer.config.Configurable

    mkdirs, toString

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 字段详细资料

    • plugin

      protected final org.bukkit.plugin.Plugin plugin
    • folder

      protected final File folder
    • files

      protected final File[] files
    • data

      protected final Map<UUID,com.google.gson.JsonObject> data
    • name

      protected final String name
  • 构造器详细资料

    • Data

      public Data(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull String name)
      建立一个名字为name的数据
      参数:
      plugin - 数据所属插件
      name - 数据名字
    • Data

      public Data(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull String name, @NotNull @NotNull String folderPath)
      建立一个名字为name的数据
      参数:
      plugin - 数据所属插件
      name - 数据名字
      folderPath - 存储数据的文件夹的名字
  • 方法详细资料

    • removeData

      public void removeData(@Nullable @Nullable UUID uuid)
      移除键为uuid的数据
      参数:
      uuid - 要移除数据的键
    • addData

      public void addData(@NotNull @NotNull UUID uuid, @NotNull @NotNull com.google.gson.JsonObject obj)
      添加键为uuid, 值为obj的数据
      参数:
      uuid - 要添加的键
      obj - 要添加的值
    • setData

      @Nullable public @Nullable com.google.gson.JsonObject setData(@NotNull @NotNull UUID uuid, @NotNull @NotNull com.google.gson.JsonObject obj)
      将键为uuid的数据的值设置为obj
      参数:
      uuid - 要修改的键
      obj - 要修改的值
      返回:
      修改前的值,如果没有,则返回null
    • getData

      @Nullable public @Nullable com.google.gson.JsonObject getData(@NotNull @NotNull UUID uuid)
      获取以uuid为键的数据对应的值
      参数:
      uuid - 要获取的数据的键
      返回:
      以uuid为键的数据对应的值
    • saveData

      public void saveData(@NotNull @NotNull UUID uuid)
      保存键为uuid的数据
    • save

      public void save()
      从类复制的说明: Configurable
      保存内存中所有的数据
      指定者:
      save 在类中 Configurable<Map<UUID,com.google.gson.JsonObject>>
    • getPlugin

      @NotNull public @NotNull org.bukkit.plugin.Plugin getPlugin()
      从类复制的说明: Configurable
      获取使用该数据的文件夹
      指定者:
      getPlugin 在类中 Configurable<Map<UUID,com.google.gson.JsonObject>>
    • getData

      @NotNull public @NotNull Map<UUID,com.google.gson.JsonObject> getData()
      指定者:
      getData 在类中 Configurable<Map<UUID,com.google.gson.JsonObject>>
      返回:
      内存中所有的数据
    • getName

      @NotNull public @NotNull String getName()
      指定者:
      getName 在类中 Configurable<Map<UUID,com.google.gson.JsonObject>>
      返回:
      该数据的名字
    • getFolder

      @NotNull public @NotNull File getFolder()
      指定者:
      getFolder 在类中 Configurable<Map<UUID,com.google.gson.JsonObject>>
      返回:
      存储该数据的文件夹
    • getFiles

      @NotNull public @NotNull File[] getFiles()
      从类复制的说明: Configurable
      获取存储数据的所有文件
      指定者:
      getFiles 在类中 Configurable<Map<UUID,com.google.gson.JsonObject>>
    • load

      @NotNull protected @NotNull Map<UUID,com.google.gson.JsonObject> load(@NotNull @NotNull File folder)
      从类复制的说明: Configurable
      从文件中加载数据
      指定者:
      load 在类中 Configurable<Map<UUID,com.google.gson.JsonObject>>
      参数:
      folder - 需要加载的文件
      返回:
      加载的数据