-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Initialize all Strength properties via constructor
- Deprecated the default constructor of Strength in favor of initializing all properties through a parameterized constructor. - Deprecated Scoring's mostGuessableMatchSequence method due to the changes in Strength's initialization. This change encourages the use of the constructor for setting all properties of the Strength class and discourages partial or post-instantiation modifications.
- Loading branch information
Showing
6 changed files
with
188 additions
and
30 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.nulabinc.zxcvbn; | ||
|
||
import com.nulabinc.zxcvbn.matchers.Match; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class MatchSequence { | ||
|
||
private final List<Match> sequence; | ||
private final double guesses; | ||
|
||
public MatchSequence(List<Match> sequence, double guesses) { | ||
this.sequence = Collections.unmodifiableList(sequence); | ||
this.guesses = guesses; | ||
} | ||
|
||
public List<Match> getSequence() { | ||
return sequence; | ||
} | ||
|
||
public double getGuesses() { | ||
return guesses; | ||
} | ||
} |
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
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
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
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
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