11.10 Map
This commit is contained in:
20
src/annotations/PasswordUtils.java
Normal file
20
src/annotations/PasswordUtils.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package annotations;//: annotations/PasswordUtils.java
|
||||
import java.util.*;
|
||||
|
||||
public class PasswordUtils {
|
||||
@UseCase(id = 47, description =
|
||||
"Passwords must contain at least one numeric")
|
||||
public boolean validatePassword(String password) {
|
||||
return (password.matches("\\w*\\d\\w*"));
|
||||
}
|
||||
@UseCase(id = 48)
|
||||
public String encryptPassword(String password) {
|
||||
return new StringBuilder(password).reverse().toString();
|
||||
}
|
||||
@UseCase(id = 49, description =
|
||||
"New passwords can't equal previously used ones")
|
||||
public boolean checkForNewPassword(
|
||||
List<String> prevPasswords, String password) {
|
||||
return !prevPasswords.contains(password);
|
||||
}
|
||||
} ///:~
|
||||
Reference in New Issue
Block a user