Class YAMLStorage
- java.lang.Object
-
- cc.carm.plugin.ultradepository.storage.impl.YAMLStorage
-
- All Implemented Interfaces:
DataStorage
public class YAMLStorage extends java.lang.Object implements DataStorage
-
-
Constructor Summary
Constructors Constructor Description YAMLStorage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.FilegetDataContainer()booleaninitialize()在插件加载存储源时执行。@Nullable UserDataloadData(@NotNull java.util.UUID uuid)用于加载用户数据的方法。voidsaveUserData(@NotNull UserData data)用于保存用户数据的方法。voidshutdown()在插件被卸载时执行。
-
-
-
Method Detail
-
initialize
public boolean initialize()
Description copied from interface:DataStorage在插件加载存储源时执行。- Specified by:
initializein interfaceDataStorage- Returns:
- 是否初始化成功
-
shutdown
public void shutdown()
Description copied from interface:DataStorage在插件被卸载时执行。- Specified by:
shutdownin interfaceDataStorage
-
getDataContainer
public java.io.File getDataContainer()
-
loadData
@Nullable public @Nullable UserData loadData(@NotNull @NotNull java.util.UUID uuid)
Description copied from interface:DataStorage用于加载用户数据的方法。该方法将会被异步运行!
该方法一般无需自行执行,见UserManager.loadData(UUID)
若不存在该用户的数据,请返回 null 。
若加载出现任何错误,请抛出异常。- Specified by:
loadDatain interfaceDataStorage- Parameters:
uuid- 用户UUID
-
saveUserData
public void saveUserData(@NotNull @NotNull UserData data) throws java.io.IOExceptionDescription copied from interface:DataStorage用于保存用户数据的方法。 该方法将会被异步运行!
该方法一般无需自行执行,见UserManager.saveData(UserData)- Specified by:
saveUserDatain interfaceDataStorage- Parameters:
data- 用户数据- Throws:
java.io.IOException
-
-