From 1b362986bc99c04941d046ebb36e19c370435b1f Mon Sep 17 00:00:00 2001 From: pascalschumacher Date: Wed, 30 Nov 2016 21:55:24 +0100 Subject: [PATCH] StringUtils improve is*Empty and is*Blank javadoc --- .../org/apache/commons/lang3/StringUtils.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java index 315416272..4183c8b07 100644 --- a/src/main/java/org/apache/commons/lang3/StringUtils.java +++ b/src/main/java/org/apache/commons/lang3/StringUtils.java @@ -230,7 +230,7 @@ public class StringUtils { } /** - *

Checks if any one of the CharSequences are empty ("") or null.

+ *

Checks if any of the CharSequences are empty ("") or null.

* *
      * StringUtils.isAnyEmpty(null)             = true
@@ -259,10 +259,11 @@ public class StringUtils {
     }
 
     /**
-     * 

Checks if any one of the CharSequences are not empty ("") or null.

+ *

Checks if any of the CharSequences are not empty ("") and not null.

* *
      * StringUtils.isAnyNotEmpty(null)             = false
+     * StringUtils.isAnyNotEmpty(new String[] {})  = false
      * StringUtils.isAnyNotEmpty(null, "foo")      = true
      * StringUtils.isAnyNotEmpty("", "bar")        = true
      * StringUtils.isAnyNotEmpty("bob", "")        = true
@@ -272,7 +273,7 @@ public class StringUtils {
      * 
* * @param css the CharSequences to check, may be null or empty - * @return {@code true} if any of the CharSequences are not empty or null + * @return {@code true} if any of the CharSequences are not empty and not null * @since 3.6 */ public static boolean isAnyNotEmpty(final CharSequence... css) { @@ -296,6 +297,7 @@ public class StringUtils { * StringUtils.isNoneEmpty("", "bar") = false * StringUtils.isNoneEmpty("bob", "") = false * StringUtils.isNoneEmpty(" bob ", null) = false + * StringUtils.isNoneEmpty(new String[] {}) = false * StringUtils.isNoneEmpty(" ", "bar") = true * StringUtils.isNoneEmpty("foo", "bar") = true *
@@ -309,7 +311,7 @@ public class StringUtils { } /** - *

Checks if a CharSequence is whitespace, empty ("") or null.

+ *

Checks if a CharSequence is empty (""), null or whitespace only.

* *

Whitespace is defined by {@link Character#isWhitespace(char)}.

* @@ -322,7 +324,7 @@ public class StringUtils { * * * @param cs the CharSequence to check, may be null - * @return {@code true} if the CharSequence is null, empty or whitespace + * @return {@code true} if the CharSequence is null, empty or whitespace only * @since 2.0 * @since 3.0 Changed signature from isBlank(String) to isBlank(CharSequence) */ @@ -354,7 +356,7 @@ public class StringUtils { * * @param cs the CharSequence to check, may be null * @return {@code true} if the CharSequence is - * not empty and not null and not whitespace + * not empty and not null and not whitespace only * @since 2.0 * @since 3.0 Changed signature from isNotBlank(String) to isNotBlank(CharSequence) */ @@ -363,7 +365,7 @@ public class StringUtils { } /** - *

Checks if any one of the CharSequences are blank ("") or null and not whitespace only.

+ *

Checks if any of the CharSequences are empty ("") or null or whitespace only.

* *

Whitespace is defined by {@link Character#isWhitespace(char)}.

* @@ -375,11 +377,12 @@ public class StringUtils { * StringUtils.isAnyBlank("bob", "") = true * StringUtils.isAnyBlank(" bob ", null) = true * StringUtils.isAnyBlank(" ", "bar") = true + * StringUtils.isAnyBlank(new String[] {}) = false * StringUtils.isAnyBlank("foo", "bar") = false * * * @param css the CharSequences to check, may be null or empty - * @return {@code true} if any of the CharSequences are blank or null or whitespace only + * @return {@code true} if any of the CharSequences are empty or null or whitespace only * @since 3.2 */ public static boolean isAnyBlank(final CharSequence... css) { @@ -395,7 +398,7 @@ public class StringUtils { } /** - *

Checks if any one of the CharSequences are not blank ("") or null and not whitespace only.

+ *

Checks if any of the CharSequences are not empty (""), not null and not whitespace only.

* *

Whitespace is defined by {@link Character#isWhitespace(char)}.

* @@ -408,10 +411,11 @@ public class StringUtils { * StringUtils.isAnyNotBlank(" bob ", null) = true * StringUtils.isAnyNotBlank(" ", "bar") = true * StringUtils.isAnyNotBlank("foo", "bar") = false + * StringUtils.isAnyNotBlank(new String[] {}) = false * * * @param css the CharSequences to check, may be null or empty - * @return {@code true} if any of the CharSequences are not blank or null or whitespace only + * @return {@code true} if any of the CharSequences are not empty and not null and not whitespace only * @since 3.6 */ public static boolean isAnyNotBlank(final CharSequence... css) { @@ -427,7 +431,7 @@ public class StringUtils { } /** - *

Checks if none of the CharSequences are blank ("") or null and whitespace only.

+ *

Checks if none of the CharSequences are empty (""), null or whitespace only.

* *

Whitespace is defined by {@link Character#isWhitespace(char)}.

* @@ -439,11 +443,12 @@ public class StringUtils { * StringUtils.isNoneBlank("bob", "") = false * StringUtils.isNoneBlank(" bob ", null) = false * StringUtils.isNoneBlank(" ", "bar") = false + * StringUtils.isNoneBlank(new String[] {}) = false * StringUtils.isNoneBlank("foo", "bar") = true * * * @param css the CharSequences to check, may be null or empty - * @return {@code true} if none of the CharSequences are blank or null or whitespace only + * @return {@code true} if none of the CharSequences are empty or null or whitespace only * @since 3.2 */ public static boolean isNoneBlank(final CharSequence... css) {