Skip to content

Commit

Permalink
Merge pull request #167 from nulab/deprecate-setters-in-AttackTimes
Browse files Browse the repository at this point in the history
refactor: Deprecate setters in AttackTimes class
  • Loading branch information
vvatanabe authored Sep 5, 2023
2 parents dcaf9da + 9914e7f commit 050c42c
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions src/main/java/com/nulabinc/zxcvbn/AttackTimes.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ public CrackTimeSeconds getCrackTimeSeconds() {
return crackTimeSeconds;
}

/**
* Sets the crack time in seconds.
*
* @param crackTimeSeconds The crack time in seconds.
* @deprecated It is recommended to initialize using the constructor.
*/
@Deprecated
public void setCrackTimeSeconds(CrackTimeSeconds crackTimeSeconds) {
this.crackTimeSeconds = crackTimeSeconds;
}
Expand All @@ -25,6 +32,13 @@ public CrackTimesDisplay getCrackTimesDisplay() {
return crackTimesDisplay;
}

/**
* Sets the display representation for the crack times.
*
* @param crackTimesDisplay The display values for crack times.
* @deprecated It is recommended to initialize using the constructor.
*/
@Deprecated
public void setCrackTimesDisplay(CrackTimesDisplay crackTimesDisplay) {
this.crackTimesDisplay = crackTimesDisplay;
}
Expand All @@ -33,6 +47,13 @@ public int getScore() {
return score;
}

/**
* Sets the score value.
*
* @param score The score value.
* @deprecated It is recommended to initialize using the constructor.
*/
@Deprecated
public void setScore(int score) {
this.score = score;
}
Expand All @@ -58,6 +79,14 @@ public double getOnlineThrottling100perHour() {
return onlineThrottling100perHour;
}

/**
* Sets the time required to crack a password with online throttling at 100 attempts per hour.
*
* @param onlineThrottling100perHour Time in seconds for online throttling at 100 attempts per
* hour.
* @deprecated This method is deprecated. It is recommended to initialize using the constructor.
*/
@Deprecated
public void setOnlineThrottling100perHour(double onlineThrottling100perHour) {
this.onlineThrottling100perHour = onlineThrottling100perHour;
}
Expand All @@ -66,6 +95,15 @@ public double getOnlineNoThrottling10perSecond() {
return onlineNoThrottling10perSecond;
}

/**
* Sets the time required to crack a password with online attacks without throttling at 10
* attempts per second.
*
* @param onlineNoThrottling10perSecond Time in seconds for online attacks without throttling at
* 10 attempts per second.
* @deprecated This method is deprecated. It is recommended to initialize using the constructor.
*/
@Deprecated
public void setOnlineNoThrottling10perSecond(double onlineNoThrottling10perSecond) {
this.onlineNoThrottling10perSecond = onlineNoThrottling10perSecond;
}
Expand All @@ -74,6 +112,15 @@ public double getOfflineSlowHashing1e4perSecond() {
return offlineSlowHashing1e4perSecond;
}

/**
* Sets the time required to crack a password with offline slow hashing at 1e4 attempts per
* second.
*
* @param offlineSlowHashing1e4perSecond Time in seconds for offline slow hashing at 1e4
* attempts per second.
* @deprecated This method is deprecated. It is recommended to initialize using the constructor.
*/
@Deprecated
public void setOfflineSlowHashing1e4perSecond(double offlineSlowHashing1e4perSecond) {
this.offlineSlowHashing1e4perSecond = offlineSlowHashing1e4perSecond;
}
Expand All @@ -82,6 +129,15 @@ public double getOfflineFastHashing1e10PerSecond() {
return offlineFastHashing1e10PerSecond;
}

/**
* Sets the time required to crack a password with offline fast hashing at 1e10 attempts per
* second.
*
* @param offlineFastHashing1e10PerSecond Time in seconds for offline fast hashing at 1e10
* attempts per second.
* @deprecated This method is deprecated. It is recommended to initialize using the constructor.
*/
@Deprecated
public void setOfflineFastHashing1e10PerSecond(double offlineFastHashing1e10PerSecond) {
this.offlineFastHashing1e10PerSecond = offlineFastHashing1e10PerSecond;
}
Expand All @@ -108,6 +164,15 @@ public String getOnlineThrottling100perHour() {
return onlineThrottling100perHour;
}

/**
* Sets the display representation for the time required to crack a password with online
* throttling at 100 attempts per hour.
*
* @param onlineThrottling100perHour Display representation for online throttling at 100
* attempts per hour.
* @deprecated This method is deprecated. It is recommended to initialize using the constructor.
*/
@Deprecated
public void setOnlineThrottling100perHour(String onlineThrottling100perHour) {
this.onlineThrottling100perHour = onlineThrottling100perHour;
}
Expand All @@ -116,6 +181,15 @@ public String getOnlineNoThrottling10perSecond() {
return onlineNoThrottling10perSecond;
}

/**
* Sets the display representation for the time required to crack a password with online attacks
* without throttling at 10 attempts per second.
*
* @param onlineNoThrottling10perSecond Display representation for online attacks without
* throttling at 10 attempts per second.
* @deprecated This method is deprecated. It is recommended to initialize using the constructor.
*/
@Deprecated
public void setOnlineNoThrottling10perSecond(String onlineNoThrottling10perSecond) {
this.onlineNoThrottling10perSecond = onlineNoThrottling10perSecond;
}
Expand All @@ -124,6 +198,15 @@ public String getOfflineSlowHashing1e4perSecond() {
return offlineSlowHashing1e4perSecond;
}

/**
* Sets the display representation for the time required to crack a password with offline slow
* hashing at 1e4 attempts per second.
*
* @param offlineSlowHashing1e4perSecond Display representation for offline slow hashing at 1e4
* attempts per second.
* @deprecated This method is deprecated. It is recommended to initialize using the constructor.
*/
@Deprecated
public void setOfflineSlowHashing1e4perSecond(String offlineSlowHashing1e4perSecond) {
this.offlineSlowHashing1e4perSecond = offlineSlowHashing1e4perSecond;
}
Expand All @@ -132,6 +215,15 @@ public String getOfflineFastHashing1e10PerSecond() {
return offlineFastHashing1e10PerSecond;
}

/**
* Sets the display representation for the time required to crack a password with offline fast
* hashing at 1e10 attempts per second.
*
* @param offlineFastHashing1e10PerSecond Display representation for offline fast hashing at
* 1e10 attempts per second.
* @deprecated This method is deprecated. It is recommended to initialize using the constructor.
*/
@Deprecated
public void setOfflineFastHashing1e10PerSecond(String offlineFastHashing1e10PerSecond) {
this.offlineFastHashing1e10PerSecond = offlineFastHashing1e10PerSecond;
}
Expand Down

0 comments on commit 050c42c

Please sign in to comment.