Package dev.selena.luacore.utils.data
Class UserFolder
java.lang.Object
dev.selena.luacore.utils.data.UserFolder
This class is required for any User folder class
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classData file class used for managing data internally -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit()Used for setting up the class extending UserFolder<T> TloadData(@NotNull Class<T> clazz, UserDataManager dataManager, @NotNull String fileName) Used for setting up the GSON mapping classes for user data using a specified instance of UserDataManager<T> TUsed for setting up the GSON mapping classes for user data
-
Constructor Details
-
UserFolder
Used for setting the UUID for various internal uses- Parameters:
uuid- The players UUID
-
-
Method Details
-
init
Used for setting up the class extending UserFolder- Throws:
NoUserJsonFoundException- when there is no Json files inside the user folder
-
loadData
Used for setting up the GSON mapping classes for user data- Type Parameters:
T- The class type- Parameters:
clazz- The class you want to map tofileName- The file name relative to the users data folder- Returns:
- The mapped class
-
loadData
public <T> T loadData(@NotNull @NotNull Class<T> clazz, UserDataManager dataManager, @NotNull @NotNull String fileName) Used for setting up the GSON mapping classes for user data using a specified instance of UserDataManager- Type Parameters:
T- The class type- Parameters:
clazz- The class you want to map todataManager- The instance of UserDataManagerfileName- The file name relative to the users data folder- Returns:
- The mapped class
-