Class JsonStore
java.lang.Object
com.ultikits.ultitools.interfaces.impl.data.json.JsonStore
- All Implemented Interfaces:
DataStore
Json Data store.
Json存储方式抽象类
Json存储方式抽象类
- Version:
- 1.0.0
- Author:
- wisdomme
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSave all possible caches and destroy all data operation classes.(package private) static voidFlush all cached data operators.(package private) static intGet the number of registered data operators.<T extends BaseDataEntity<String>>
DataOperator<T> getOperator(UltiToolsPlugin plugin, Class<T> dataEntity) Get data operation entity class.<T extends BaseDataEntity<String>>
DataOperator<T> getOperator(File dataFolder, Class<T> dataEntity) Get data operator for an external plugin, scoped to the plugin's own data folder.Get the type of data storage.private static voidInitialize the flush scheduler.(package private) static voidReset the scheduler state.
-
Field Details
-
dataOperatorMap
-
schedulerInitialized
private static volatile boolean schedulerInitialized -
storeLocation
-
-
Constructor Details
-
JsonStore
-
-
Method Details
-
initScheduler
private static void initScheduler()Initialize the flush scheduler. Called lazily when first JsonStore is created. This avoids static initializer issues in test environments. -
flushAllCaches
static void flushAllCaches()Flush all cached data operators. This method is extracted from BukkitRunnable for testability. -
getDataOperatorCount
static int getDataOperatorCount()Get the number of registered data operators. Used for testing. -
resetSchedulerState
static void resetSchedulerState()Reset the scheduler state. Used for testing. -
getOperator
public <T extends BaseDataEntity<String>> DataOperator<T> getOperator(UltiToolsPlugin plugin, Class<T> dataEntity) Description copied from interface:DataStoreGet data operation entity class.获取数据操作实体类
- Specified by:
getOperatorin interfaceDataStore- Type Parameters:
T- Must inheritBaseDataEntity- Parameters:
plugin- Plugin
插件dataEntity- Data entity class
数据实体类- Returns:
- Data operation entity
数据操作实体
-
getOperator
public <T extends BaseDataEntity<String>> DataOperator<T> getOperator(File dataFolder, Class<T> dataEntity) Description copied from interface:DataStoreGet data operator for an external plugin, scoped to the plugin's own data folder.获取外部插件的数据操作器,数据范围限定在插件自己的数据文件夹中。
- Specified by:
getOperatorin interfaceDataStore- Type Parameters:
T- entity type- Parameters:
dataFolder- the external plugin's data folder (e.g., plugins/MyPlugin/)dataEntity- data entity class- Returns:
- data operator
-
destroyAllOperators
public void destroyAllOperators()Description copied from interface:DataStoreSave all possible caches and destroy all data operation classes.保存所有可能的缓存并销毁所有的数据操作类
- Specified by:
destroyAllOperatorsin interfaceDataStore
-
getStoreType
Description copied from interface:DataStoreGet the type of data storage.获取此数据存储的类型
- Specified by:
getStoreTypein interfaceDataStore- Returns:
- Data storage type
数据存储类型
-