Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Deprecate com.nulabinc.zxcvbn.Matcher and introduce new interface in com.nulabinc.zxcvbn.matchers #165

Merged
merged 2 commits into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/main/java/com/nulabinc/zxcvbn/Matcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
import com.nulabinc.zxcvbn.matchers.Match;
import java.util.List;

/**
* Represents a matcher responsible for identifying patterns within passwords.
*
* <p>Implementations of this interface provide specific matching strategies to detect various
* patterns such as dictionary words, sequences, and spatial patterns.
*
* @deprecated This interface is deprecated. Use {@link com.nulabinc.zxcvbn.matchers.Matcher}
* instead.
*/
@Deprecated
public interface Matcher {
public List<Match> execute(CharSequence password);
List<Match> execute(CharSequence password);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.nulabinc.zxcvbn.matchers;

import com.nulabinc.zxcvbn.Context;
import com.nulabinc.zxcvbn.Matcher;
import java.io.Serializable;
import java.util.Collections;
import java.util.Comparator;
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/com/nulabinc/zxcvbn/matchers/Matcher.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.nulabinc.zxcvbn.matchers;

import java.util.List;

/**
* Represents a matcher responsible for identifying patterns within passwords.
*
* <p>Implementations of this interface provide specific matching strategies to detect various
* patterns such as dictionary words, sequences, and spatial patterns.
*
* @see Match
*/
public interface Matcher {
/**
* Analyzes the given password and returns a list of detected patterns as {@link Match} objects.
*
* @param password the password to analyze for patterns.
* @return a list of matches identifying patterns found within the password.
*/
List<Match> execute(CharSequence password);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.nulabinc.zxcvbn.matchers;

import com.nulabinc.zxcvbn.Context;
import com.nulabinc.zxcvbn.Matcher;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down