Skip to content

Commit

Permalink
Deprecate com.nulabinc.zxcvbn.Matcher and introduce new interface in …
Browse files Browse the repository at this point in the history
…com.nulabinc.zxcvbn.matchers
  • Loading branch information
vvatanabe committed Sep 3, 2023
1 parent 1f5f839 commit 9828086
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
7 changes: 6 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,11 @@
import com.nulabinc.zxcvbn.matchers.Match;
import java.util.List;

/**
* @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

0 comments on commit 9828086

Please sign in to comment.