Package passport.domain.contexts.user
Class UserEditing.EditingWithTarget
java.lang.Object
passport.domain.contexts.user.UserEditing.EditingWithTarget
-
Constructor Summary
ConstructorDescriptionEditingWithTarget
(Users repository, User target) Constructs an EditingWithTarget instance with the specified repository and user. -
Method Summary
Modifier and TypeMethodDescriptionUpdates the user's CPF.void
edit()
Commits the changes to the user.Updates the user's email.Updates the user's name.Updates the user's password.
-
Constructor Details
-
EditingWithTarget
-
-
Method Details
-
name
Updates the user's name.- Parameters:
name
- the new name- Returns:
- the current EditingWithTarget instance
-
cpf
Updates the user's CPF.- Parameters:
cpf
- the new CPF- Returns:
- the current EditingWithTarget instance
-
email
Updates the user's email.- Parameters:
rawEmail
- the new email as a stirng- Returns:
- the current EditingWithTarget instance
- Throws:
EmailAlreadyExists
- if the email already exists in the repository
-
password
Updates the user's password.- Parameters:
password
- the new password- Returns:
- the current EditingWithTarget instance
-
edit
public void edit()Commits the changes to the user.
-