generated from mate-academy/jv-homework-template
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8fe6286
commit 386358d
Showing
1 changed file
with
2 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,6 @@ | ||
package core.basesyntax; | ||
|
||
public class PasswordValidator { | ||
public static final int MIN_PASSWORD_LENGTH = 10; | ||
|
||
public void validate(String password, String repeatPassword) throws PasswordValidationException { | ||
if (password == null || repeatPassword == null) { | ||
throw new PasswordValidationException("Password cannot be null"); | ||
} | ||
|
||
if (!password.equals(repeatPassword)) { | ||
throw new PasswordValidationException("Passwords do not match"); | ||
} | ||
|
||
if (password.length() < MIN_PASSWORD_LENGTH) { | ||
throw new PasswordValidationException("Password is too short"); | ||
} | ||
public void validate(String password, String repeatPassword) { | ||
//write your code here | ||
} | ||
} |