StructuredData
This class stores all the user data. It uses an instance of Entity
class to store the User
instances. Currently, the app uses only one instance of this class as a global class named data
.
Properties
Properties
entity Entity
Entity stores data using Map
with some extra functionality.
Methods
addUser(user) boolean
Adds the user to the dataset.
Returns true
if a the user is succefully added.
Returns false
if the user is not added.
getUser(id) User
Gets the user from the dataset using its id.
deleteUser(id) boolean
Deletes the user from the dataset with the user id.
Returns true
if a the user is succefully deleted.
Returns false
if the user is not deleted.
isUser(id) boolean
Check if a user with the given id exists
clearData() void
Clears all the data stored