This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git
The following commit(s) were added to refs/heads/master by this push:
new afdf3ad6 Javadoc
afdf3ad6 is described below
commit afdf3ad6e5c83c0ca1cbd47fa5d18d31b66cb1db
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Aug 6 11:16:23 2026 -0400
Javadoc
---
.../commons/codec/language/SoundexUtils.java | 64 ++++++++--------------
1 file changed, 23 insertions(+), 41 deletions(-)
diff --git a/src/main/java/org/apache/commons/codec/language/SoundexUtils.java
b/src/main/java/org/apache/commons/codec/language/SoundexUtils.java
index 530a90d2..5c0095d8 100644
--- a/src/main/java/org/apache/commons/codec/language/SoundexUtils.java
+++ b/src/main/java/org/apache/commons/codec/language/SoundexUtils.java
@@ -24,19 +24,18 @@ import org.apache.commons.codec.StringEncoder;
/**
* Utility methods for {@link Soundex} and {@link RefinedSoundex} classes.
- *
- * <p>This class is immutable and thread-safe.</p>
+ * <p>
+ * This class is immutable and thread-safe.
+ * </p>
*
* @since 1.3
*/
final class SoundexUtils {
/**
- * Cleans up the input string before Soundex processing by only returning
- * upper case letters.
+ * Cleans up the input string before Soundex processing by only returning
upper case letters.
*
- * @param str
- * The String to clean.
+ * @param str The String to clean.
* @return A clean String.
*/
static String clean(final String str) {
@@ -58,57 +57,39 @@ final class SoundexUtils {
}
/**
- * Encodes the Strings and returns the number of characters in the two
- * encoded Strings that are the same.
+ * Encodes the Strings and returns the number of characters in the two
encoded Strings that are the same.
* <ul>
- * <li>For Soundex, this return value ranges from 0 through 4: 0 indicates
- * little or no similarity, and 4 indicates strong similarity or identical
+ * <li>For Soundex, this return value ranges from 0 through 4: 0 indicates
little or no similarity, and 4 indicates strong similarity or identical
* values.</li>
* <li>For refined Soundex, the return value can be greater than 4.</li>
* </ul>
*
- * @param encoder
- * The encoder to use to encode the Strings.
- * @param s1
- * A String that will be encoded and compared.
- * @param s2
- * A String that will be encoded and compared.
- * @return The number of characters in the two Soundex encoded Strings that
- * are the same.
- *
+ * @param encoder The encoder to use to encode the Strings.
+ * @param s1 A String that will be encoded and compared.
+ * @param s2 A String that will be encoded and compared.
+ * @return The number of characters in the two Soundex encoded Strings
that are the same.
* @see #differenceEncoded(String,String)
- * @see <a
href="https://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_de-dz_8co5.asp">
- * MS T-SQL DIFFERENCE</a>
- *
- * @throws EncoderException
- * if an error occurs encoding one of the strings.
+ * @see <a
href="https://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_de-dz_8co5.asp">
MS T-SQL DIFFERENCE</a>
+ * @throws EncoderException if an error occurs encoding one of the strings.
*/
static int difference(final StringEncoder encoder, final String s1, final
String s2) throws EncoderException {
return differenceEncoded(encoder.encode(s1), encoder.encode(s2));
}
/**
- * Returns the number of characters in the two Soundex encoded Strings that
- * are the same.
+ * Returns the number of characters in the two Soundex encoded Strings
that are the same.
* <ul>
- * <li>For Soundex, this return value ranges from 0 through 4: 0 indicates
- * little or no similarity, and 4 indicates strong similarity or identical
+ * <li>For Soundex, this return value ranges from 0 through 4: 0 indicates
little or no similarity, and 4 indicates strong similarity or identical
* values.</li>
* <li>For refined Soundex, the return value can be greater than 4.</li>
* </ul>
*
- * @param es1
- * An encoded String.
- * @param es2
- * An encoded String.
- * @return The number of characters in the two Soundex encoded Strings that
- * are the same.
- *
- * @see <a
href="https://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_de-dz_8co5.asp">
- * MS T-SQL DIFFERENCE</a>
+ * @param es1 An encoded String.
+ * @param es2 An encoded String.
+ * @return The number of characters in the two Soundex encoded Strings
that are the same.
+ * @see <a
href="https://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_de-dz_8co5.asp">
MS T-SQL DIFFERENCE</a>
*/
static int differenceEncoded(final String es1, final String es2) {
-
if (es1 == null || es2 == null) {
return 0;
}
@@ -123,7 +104,9 @@ final class SoundexUtils {
}
/**
- * <p>Checks if a CharSequence is empty ("") or null.</p>
+ * <p>
+ * Checks if a CharSequence is empty ("") or null.
+ * </p>
*
* <pre>
* StringUtils.isEmpty(null) = true
@@ -133,11 +116,10 @@ final class SoundexUtils {
* StringUtils.isEmpty(" bob ") = false
* </pre>
*
- * @param cs The CharSequence to check, may be null.
+ * @param cs The CharSequence to check, may be null.
* @return {@code true} if the CharSequence is empty or null.
*/
static boolean isEmpty(final CharSequence cs) {
return cs == null || cs.length() == 0;
}
-
}