Skip to content

Commit

Permalink
feat(UserManager): Update constructor for storage systems
Browse files Browse the repository at this point in the history
This commit updates the `UserManager` class constructor. The previous constructor was refactored to remove the multiple if-else statements for type checking and replaced with a `switch` statement. Additionally, the new constructor adds fields for `File directory` , `Connection conn`, and `MongoDB db`, depending on the storage type. This allows for more flexibility and easier maintenance of the class. Finally, the `usersDirectory` field is now created if it does not exist. This change is a feature addition and improves the class's usability.
  • Loading branch information
GeorgeV220 committed Apr 17, 2023
1 parent a03ef07 commit 83d3eb4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class UserManager {
*
* @param type the type of storage system to be used (JSON, SQL or MONGODB)
* @param obj the object to be used for storage (File for JSON, Connection for SQL and MongoDB for MONGODB)
* @param collectionName the name of the collection to be used for MONGODB, null for other types
* @param collectionName the name of the collection to be used for MONGODB and SQL, null for other types
*/
public UserManager(@NotNull Type type, Object obj, @Nullable String collectionName) {
this.type = type;
Expand Down Expand Up @@ -93,7 +93,7 @@ public UserManager registerObjectMapSerializer() {
}

/**
* Registers type adapters for the specified classes using the GsonBuilder.
* Register type adapters for the specified classes using the GsonBuilder.
*
* @param pairs a PairDocument containing the Class and type adapter pairs to register
* @return this UserManager
Expand Down

0 comments on commit 83d3eb4

Please sign in to comment.