Package com.cis.gorecipe.dto
Class UserDTO
java.lang.Object
com.cis.gorecipe.dto.UserDTO
This class acts as a transfer object for the User class to allow serialization of Users without
making the password field visible
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DateThe user's birthdayA list of restrictions on which recipes the user can cookprivate StringAn email address to allow communication with the userprivate Set<Ingredient>A list of ingredients which the user would like to cook withprivate StringThe user's first nameprivate LongThe primary key of the userprivate StringThe user's last nameprivate StringA salted and hashed passwordA list of recipes which the user would like to revisit in the futureprivate StringA unique string for user login -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
id
The primary key of the user -
username
A unique string for user login -
password
A salted and hashed password -
email
An email address to allow communication with the user -
firstName
The user's first name -
lastName
The user's last name -
birthDate
The user's birthday -
favoriteIngredients
A list of ingredients which the user would like to cook with -
savedRecipes
A list of recipes which the user would like to revisit in the future -
dietaryRestrictions
A list of restrictions on which recipes the user can cook
-
-
Constructor Details
-
UserDTO
- Parameters:
user- a User object to be converted for serialization
-
-
Method Details
-
mapFromUser
- Parameters:
user- a User object to be converted for serialization- Returns:
- a UserDTO object to be used for serialization
-
mapToUser
- Parameters:
userDTO- a UserDTO object to be converted for internal use- Returns:
- a User object to be used internally
-