Skip to content

Commit

Permalink
PasswordValidator.java
Browse files Browse the repository at this point in the history
  • Loading branch information
OksanaEnko authored Oct 15, 2024
1 parent 8fe6286 commit 386358d
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/main/java/core/basesyntax/PasswordValidator.java
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
}
}

0 comments on commit 386358d

Please sign in to comment.