s
+ * @param array an array of {@code Boolean}s
* @return {@code true} if the xor is successful.
* @throws IllegalArgumentException if {@code array} is {@code null}
* @throws IllegalArgumentException if {@code array} is empty.
diff --git a/src/main/java/org/apache/commons/lang3/CharUtils.java b/src/main/java/org/apache/commons/lang3/CharUtils.java
index c0aa309bb..edabff03a 100644
--- a/src/main/java/org/apache/commons/lang3/CharUtils.java
+++ b/src/main/java/org/apache/commons/lang3/CharUtils.java
@@ -19,8 +19,8 @@
/**
* Operations on char primitives and Character objects.
*
- * This class tries to handle null
input gracefully.
- * An exception will not be thrown for a null
input.
+ *
This class tries to handle {@code null} input gracefully.
+ * An exception will not be thrown for a {@code null} input.
* Each method documents its behaviour in more detail.
*
* #ThreadSafe#
@@ -52,7 +52,7 @@ public class CharUtils {
private static final Character[] CHAR_ARRAY = new Character[128];
/**
- * \u000a
linefeed LF ('\n').
+ * {@code \u000a} linefeed LF ('\n').
*
* @see JLF: Escape Sequences
* for Character and String Literals
@@ -61,7 +61,7 @@ public class CharUtils {
public static final char LF = '\n';
/**
- * \u000d
carriage return CR ('\r').
+ * {@code \u000d} carriage return CR ('\r').
*
* @see JLF: Escape Sequences
* for Character and String Literals
@@ -78,8 +78,8 @@ public class CharUtils {
}
/**
- * CharUtils
instances should NOT be constructed in standard programming.
- * Instead, the class should be used as CharUtils.toString('c');
.
+ * {@code CharUtils} instances should NOT be constructed in standard programming.
+ * Instead, the class should be used as {@code CharUtils.toString('c');}.
*
* This constructor is public to permit tools that require a JavaBean instance
* to operate.
@@ -136,7 +136,7 @@ public static Character toCharacterObject(String str) {
//-----------------------------------------------------------------------
/**
- * Converts the Character to a char throwing an exception for null
.
+ * Converts the Character to a char throwing an exception for {@code null}.
*
*
* CharUtils.toChar(null) = IllegalArgumentException
@@ -156,7 +156,7 @@ public static char toChar(Character ch) {
}
/**
- * Converts the Character to a char handling null
.
+ * Converts the Character to a char handling {@code null}.
*
*
* CharUtils.toChar(null, 'X') = 'X'
@@ -339,7 +339,7 @@ public static String toString(char ch) {
* For ASCII 7 bit characters, this uses a cache that will return the
* same String object each time.
*
- * If null
is passed in, null
will be returned.
+ * If {@code null} is passed in, {@code null} will be returned.
*
*
* CharUtils.toString(null) = null
@@ -387,7 +387,7 @@ public static String unicodeEscaped(char ch) {
*
* This format is the Java source code format.
*
- * If null
is passed in, null
will be returned.
+ * If {@code null} is passed in, {@code null} will be returned.
*
*
* CharUtils.unicodeEscaped(null) = null
diff --git a/src/main/java/org/apache/commons/lang3/ClassUtils.java b/src/main/java/org/apache/commons/lang3/ClassUtils.java
index 80b784a06..42c58c8ea 100644
--- a/src/main/java/org/apache/commons/lang3/ClassUtils.java
+++ b/src/main/java/org/apache/commons/lang3/ClassUtils.java
@@ -29,13 +29,13 @@
/**
* Operates on classes without using reflection.
*
- * This class handles invalid null
inputs as best it can.
+ *
This class handles invalid {@code null} inputs as best it can.
* Each method documents its behaviour in more detail.
*
- * The notion of a canonical name
includes the human
- * readable name for the type, for example int[]
. The
+ *
The notion of a {@code canonical name} includes the human
+ * readable name for the type, for example {@code int[]}. The
* non-canonical method variants work with the JVM names, such as
- * [I
.
+ * {@code [I}.
*
* @author Apache Software Foundation
* @author Gary Gregory
@@ -53,7 +53,7 @@ public class ClassUtils {
public static final char PACKAGE_SEPARATOR_CHAR = '.';
/**
- * The package separator String: "."
.
+ * The package separator String: {@code "."}.
*/
public static final String PACKAGE_SEPARATOR = String.valueOf(PACKAGE_SEPARATOR_CHAR);
@@ -63,12 +63,12 @@ public class ClassUtils {
public static final char INNER_CLASS_SEPARATOR_CHAR = '$';
/**
- * The inner class separator String: "$"
.
+ * The inner class separator String: {@code "$"}.
*/
public static final String INNER_CLASS_SEPARATOR = String.valueOf(INNER_CLASS_SEPARATOR_CHAR);
/**
- * Maps primitive Class
es to their corresponding wrapper Class
.
+ * Maps primitive {@code Class}es to their corresponding wrapper {@code Class}.
*/
private static final Map, Class>> primitiveWrapperMap = new HashMap, Class>>();
static {
@@ -84,7 +84,7 @@ public class ClassUtils {
}
/**
- * Maps wrapper Class
es to their corresponding primitive types.
+ * Maps wrapper {@code Class}es to their corresponding primitive types.
*/
private static final Map, Class>> wrapperPrimitiveMap = new HashMap, Class>>();
static {
@@ -134,7 +134,7 @@ private static void addAbbreviation(String primitive, String abbreviation) {
/**
* ClassUtils instances should NOT be constructed in standard programming.
* Instead, the class should be used as
- * ClassUtils.getShortClassName(cls)
.
+ * {@code ClassUtils.getShortClassName(cls)}.
*
* This constructor is public to permit tools that require a JavaBean
* instance to operate.
@@ -146,7 +146,7 @@ public ClassUtils() {
// Short class name
// ----------------------------------------------------------------------
/**
- * Gets the class name minus the package name for an Object
.
+ * Gets the class name minus the package name for an {@code Object}.
*
* @param object the class to get the short name for, may be null
* @param valueIfNull the value to return if null
@@ -160,7 +160,7 @@ public static String getShortClassName(Object object, String valueIfNull) {
}
/**
- * Gets the class name minus the package name from a Class
.
+ * Gets the class name minus the package name from a {@code Class}.
*
* @param cls the class to get the short name for.
* @return the class name without the package name or an empty string
@@ -219,7 +219,7 @@ public static String getShortClassName(String className) {
// Package name
// ----------------------------------------------------------------------
/**
- * Gets the package name of an Object
.
+ * Gets the package name of an {@code Object}.
*
* @param object the class to get the package name for, may be null
* @param valueIfNull the value to return if null
@@ -233,9 +233,9 @@ public static String getPackageName(Object object, String valueIfNull) {
}
/**
- * Gets the package name of a Class
.
+ * Gets the package name of a {@code Class}.
*
- * @param cls the class to get the package name for, may be null
.
+ * @param cls the class to get the package name for, may be {@code null}.
* @return the package name or an empty string
*/
public static String getPackageName(Class> cls) {
@@ -246,12 +246,12 @@ public static String getPackageName(Class> cls) {
}
/**
- * Gets the package name from a String
.
+ * Gets the package name from a {@code String}.
*
* The string passed in is assumed to be a class name - it is not checked.
* If the class is unpackaged, return an empty string.
*
- * @param className the className to get the package name for, may be null
+ * @param className the className to get the package name for, may be {@code null}
* @return the package name or an empty string
*/
public static String getPackageName(String className) {
@@ -278,11 +278,11 @@ public static String getPackageName(String className) {
// Superclasses/Superinterfaces
// ----------------------------------------------------------------------
/**
- * Gets a List
of superclasses for the given class.
+ * Gets a {@code List} of superclasses for the given class.
*
- * @param cls the class to look up, may be null
- * @return the List
of superclasses in order going up from this one
- * null
if null input
+ * @param cls the class to look up, may be {@code null}
+ * @return the {@code List} of superclasses in order going up from this one
+ * {@code null} if null input
*/
public static List> getAllSuperclasses(Class> cls) {
if (cls == null) {
@@ -298,7 +298,7 @@ public static List> getAllSuperclasses(Class> cls) {
}
/**
- * Gets a List
of all interfaces implemented by the given
+ *
Gets a {@code List} of all interfaces implemented by the given
* class and its superclasses.
*
* The order is determined by looking through each interface in turn as
@@ -306,9 +306,9 @@ public static List> getAllSuperclasses(Class> cls) {
* superclass is considered in the same way. Later duplicates are ignored,
* so the order is maintained.
*
- * @param cls the class to look up, may be null
- * @return the List
of interfaces in order,
- * null
if null input
+ * @param cls the class to look up, may be {@code null}
+ * @return the {@code List} of interfaces in order,
+ * {@code null} if null input
*/
public static List> getAllInterfaces(Class> cls) {
if (cls == null) {
@@ -324,8 +324,8 @@ public static List> getAllInterfaces(Class> cls) {
/**
* Get the interfaces for the specified class.
*
- * @param cls the class to look up, may be null
- * @param interfacesFound the Set
of interfaces for the class
+ * @param cls the class to look up, may be {@code null}
+ * @param interfacesFound the {@code Set} of interfaces for the class
*/
private static void getAllInterfaces(Class> cls, HashSet> interfacesFound) {
while (cls != null) {
@@ -344,15 +344,15 @@ private static void getAllInterfaces(Class> cls, HashSet> interfacesF
// Convert list
// ----------------------------------------------------------------------
/**
- * Given a List
of class names, this method converts them into classes.
+ * Given a {@code List} of class names, this method converts them into classes.
*
- * A new List
is returned. If the class name cannot be found, null
- * is stored in the List
. If the class name in the List
is
- * null
, null
is stored in the output List
.
+ * A new {@code List} is returned. If the class name cannot be found, {@code null}
+ * is stored in the {@code List}. If the class name in the {@code List} is
+ * {@code null}, {@code null} is stored in the output {@code List}.
*
* @param classNames the classNames to change
- * @return a List
of Class objects corresponding to the class names,
- * null
if null input
+ * @return a {@code List} of Class objects corresponding to the class names,
+ * {@code null} if null input
* @throws ClassCastException if classNames contains a non String entry
*/
public static List> convertClassNamesToClasses(List classNames) {
@@ -371,16 +371,16 @@ public static List> convertClassNamesToClasses(List classNames)
}
/**
- * Given a List
of Class
objects, this method converts
+ *
Given a {@code List} of {@code Class} objects, this method converts
* them into class names.
*
- * A new List
is returned. null
objects will be copied into
- * the returned list as null
.
+ * A new {@code List} is returned. {@code null} objects will be copied into
+ * the returned list as {@code null}.
*
* @param classes the classes to change
- * @return a List
of class names corresponding to the Class objects,
- * null
if null input
- * @throws ClassCastException if classes
contains a non-Class
entry
+ * @return a {@code List} of class names corresponding to the Class objects,
+ * {@code null} if null input
+ * @throws ClassCastException if {@code classes} contains a non-{@code Class} entry
*/
public static List convertClassesToClassNames(List> classes) {
if (classes == null) {
@@ -409,19 +409,19 @@ public static List convertClassesToClassNames(List> classes) {
*
* Unlike the {@link Class#isAssignableFrom(java.lang.Class)} method, this
* method takes into account widenings of primitive classes and
- * null
s.
+ * {@code null}s.
*
- * Primitive widenings allow an int to be assigned to a long
,
- * float
or double
. This method returns the correct
+ *
Primitive widenings allow an int to be assigned to a {@code long},
+ * {@code float} or {@code double}. This method returns the correct
* result for these cases.
*
- * Null
may be assigned to any reference type. This method will
- * return true
if null
is passed in and the toClass is
+ *
{@code Null} may be assigned to any reference type. This method will
+ * return {@code true} if {@code null} is passed in and the toClass is
* non-primitive.
*
* Specifically, this method tests whether the type represented by the
- * specified Class
parameter can be converted to the type
- * represented by this Class
object via an identity conversion
+ * specified {@code Class} parameter can be converted to the type
+ * represented by this {@code Class} object via an identity conversion
* widening primitive or widening reference conversion. See
* The Java Language Specification,
* sections 5.1.1, 5.1.2 and 5.1.4 for details.
@@ -431,9 +431,9 @@ public static List convertClassesToClassNames(List> classes) {
* to the running Java version; i.e. autoboxing will be the default
* behavior in VMs running Java versions >= 1.5.
*
- * @param classArray the array of Classes to check, may be null
- * @param toClassArray the array of Classes to try to assign into, may be null
- * @return true
if assignment possible
+ * @param classArray the array of Classes to check, may be {@code null}
+ * @param toClassArray the array of Classes to try to assign into, may be {@code null}
+ * @return {@code true} if assignment possible
*/
public static boolean isAssignable(Class>[] classArray, Class>[] toClassArray) {
return isAssignable(classArray, toClassArray, SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_5));
@@ -449,27 +449,27 @@ public static boolean isAssignable(Class>[] classArray, Class>[] toClassArra
*
* Unlike the {@link Class#isAssignableFrom(java.lang.Class)} method, this
* method takes into account widenings of primitive classes and
- * null
s.
+ * {@code null}s.
*
- * Primitive widenings allow an int to be assigned to a long
,
- * float
or double
. This method returns the correct
+ *
Primitive widenings allow an int to be assigned to a {@code long},
+ * {@code float} or {@code double}. This method returns the correct
* result for these cases.
*
- * Null
may be assigned to any reference type. This method will
- * return true
if null
is passed in and the toClass is
+ *
{@code Null} may be assigned to any reference type. This method will
+ * return {@code true} if {@code null} is passed in and the toClass is
* non-primitive.
*
* Specifically, this method tests whether the type represented by the
- * specified Class
parameter can be converted to the type
- * represented by this Class
object via an identity conversion
+ * specified {@code Class} parameter can be converted to the type
+ * represented by this {@code Class} object via an identity conversion
* widening primitive or widening reference conversion. See
* The Java Language Specification,
* sections 5.1.1, 5.1.2 and 5.1.4 for details.
*
- * @param classArray the array of Classes to check, may be null
- * @param toClassArray the array of Classes to try to assign into, may be null
+ * @param classArray the array of Classes to check, may be {@code null}
+ * @param toClassArray the array of Classes to try to assign into, may be {@code null}
* @param autoboxing whether to use implicit autoboxing/unboxing between primitives and wrappers
- * @return true
if assignment possible
+ * @return {@code true} if assignment possible
*/
public static boolean isAssignable(Class>[] classArray, Class>[] toClassArray, boolean autoboxing) {
if (ArrayUtils.isSameLength(classArray, toClassArray) == false) {
@@ -490,23 +490,23 @@ public static boolean isAssignable(Class>[] classArray, Class>[] toClassArra
}
/**
- * Checks if one Class
can be assigned to a variable of
- * another Class
.
+ * Checks if one {@code Class} can be assigned to a variable of
+ * another {@code Class}.
*
* Unlike the {@link Class#isAssignableFrom(java.lang.Class)} method,
* this method takes into account widenings of primitive classes and
- * null
s.
+ * {@code null}s.
*
* Primitive widenings allow an int to be assigned to a long, float or
* double. This method returns the correct result for these cases.
*
- * Null
may be assigned to any reference type. This method
- * will return true
if null
is passed in and the
+ *
{@code Null} may be assigned to any reference type. This method
+ * will return {@code true} if {@code null} is passed in and the
* toClass is non-primitive.
*
* Specifically, this method tests whether the type represented by the
- * specified Class
parameter can be converted to the type
- * represented by this Class
object via an identity conversion
+ * specified {@code Class} parameter can be converted to the type
+ * represented by this {@code Class} object via an identity conversion
* widening primitive or widening reference conversion. See
* The Java Language Specification,
* sections 5.1.1, 5.1.2 and 5.1.4 for details.
@@ -518,30 +518,30 @@ public static boolean isAssignable(Class>[] classArray, Class>[] toClassArra
*
* @param cls the Class to check, may be null
* @param toClass the Class to try to assign into, returns false if null
- * @return true
if assignment possible
+ * @return {@code true} if assignment possible
*/
public static boolean isAssignable(Class> cls, Class> toClass) {
return isAssignable(cls, toClass, SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_5));
}
/**
- * Checks if one Class
can be assigned to a variable of
- * another Class
.
+ * Checks if one {@code Class} can be assigned to a variable of
+ * another {@code Class}.
*
* Unlike the {@link Class#isAssignableFrom(java.lang.Class)} method,
* this method takes into account widenings of primitive classes and
- * null
s.
+ * {@code null}s.
*
* Primitive widenings allow an int to be assigned to a long, float or
* double. This method returns the correct result for these cases.
*
- * Null
may be assigned to any reference type. This method
- * will return true
if null
is passed in and the
+ *
{@code Null} may be assigned to any reference type. This method
+ * will return {@code true} if {@code null} is passed in and the
* toClass is non-primitive.
*
* Specifically, this method tests whether the type represented by the
- * specified Class
parameter can be converted to the type
- * represented by this Class
object via an identity conversion
+ * specified {@code Class} parameter can be converted to the type
+ * represented by this {@code Class} object via an identity conversion
* widening primitive or widening reference conversion. See
* The Java Language Specification,
* sections 5.1.1, 5.1.2 and 5.1.4 for details.
@@ -549,7 +549,7 @@ public static boolean isAssignable(Class> cls, Class> toClass) {
* @param cls the Class to check, may be null
* @param toClass the Class to try to assign into, returns false if null
* @param autoboxing whether to use implicit autoboxing/unboxing between primitives and wrappers
- * @return true
if assignment possible
+ * @return {@code true} if assignment possible
*/
public static boolean isAssignable(Class> cls, Class> toClass, boolean autoboxing) {
if (toClass == null) {
@@ -628,12 +628,12 @@ public static boolean isAssignable(Class> cls, Class> toClass, boolean autob
* Converts the specified primitive Class object to its corresponding
* wrapper Class object.
*
- * NOTE: From v2.2, this method handles Void.TYPE
,
- * returning Void.TYPE
.
+ * NOTE: From v2.2, this method handles {@code Void.TYPE},
+ * returning {@code Void.TYPE}.
*
* @param cls the class to convert, may be null
- * @return the wrapper class for cls
or cls
if
- * cls
is not a primitive. null
if null input.
+ * @return the wrapper class for {@code cls} or {@code cls} if
+ * {@code cls} is not a primitive. {@code null} if null input.
* @since 2.1
*/
public static Class> primitiveToWrapper(Class> cls) {
@@ -650,7 +650,7 @@ public static Class> primitiveToWrapper(Class> cls) {
*
* @param classes the class array to convert, may be null or empty
* @return an array which contains for each given class, the wrapper class or
- * the original class if class is not a primitive. null
if null input.
+ * the original class if class is not a primitive. {@code null} if null input.
* Empty array if an empty array passed in.
* @since 2.1
*/
@@ -674,14 +674,14 @@ public static Class>[] primitivesToWrappers(Class>[] classes) {
* Converts the specified wrapper class to its corresponding primitive
* class.
*
- * This method is the counter part of primitiveToWrapper()
.
+ *
This method is the counter part of {@code primitiveToWrapper()}.
* If the passed in class is a wrapper class for a primitive type, this
- * primitive type will be returned (e.g. Integer.TYPE
for
- * Integer.class
). For other classes, or if the parameter is
+ * primitive type will be returned (e.g. {@code Integer.TYPE} for
+ * {@code Integer.class}). For other classes, or if the parameter is
* null, the return value is null.
*
* @param cls the class to convert, may be null
- * @return the corresponding primitive type if cls
is a
+ * @return the corresponding primitive type if {@code cls} is a
* wrapper class, null otherwise
* @see #primitiveToWrapper(Class)
* @since 2.4
@@ -694,12 +694,12 @@ public static Class> wrapperToPrimitive(Class> cls) {
* Converts the specified array of wrapper Class objects to an array of
* its corresponding primitive Class objects.
*
- * This method invokes wrapperToPrimitive()
for each element
+ *
This method invokes {@code wrapperToPrimitive()} for each element
* of the passed in array.
*
* @param classes the class array to convert, may be null or empty
* @return an array which contains for each given class, the primitive class or
- * null if the original class is not a wrapper class. null
if null input.
+ * null if the original class is not a wrapper class. {@code null} if null input.
* Empty array if an empty array passed in.
* @see #wrapperToPrimitive(Class)
* @since 2.4
@@ -726,8 +726,8 @@ public static Class>[] wrappersToPrimitives(Class>[] classes) {
* Is the specified class an inner class or static nested class.
*
* @param cls the class to check, may be null
- * @return true
if the class is an inner or static nested class,
- * false if not or null
+ * @return {@code true} if the class is an inner or static nested class,
+ * false if not or {@code null}
*/
public static boolean isInnerClass(Class> cls) {
return cls != null && cls.getEnclosingClass() != null;
@@ -736,15 +736,15 @@ public static boolean isInnerClass(Class> cls) {
// Class loading
// ----------------------------------------------------------------------
/**
- * Returns the class represented by className
using the
- * classLoader
. This implementation supports the syntaxes
- * "java.util.Map.Entry[]
", "java.util.Map$Entry[]
",
- * "[Ljava.util.Map.Entry;
", and "[Ljava.util.Map$Entry;
".
+ * Returns the class represented by {@code className} using the
+ * {@code classLoader}. This implementation supports the syntaxes
+ * "{@code java.util.Map.Entry[]}", "{@code java.util.Map$Entry[]}",
+ * "{@code [Ljava.util.Map.Entry;}", and "{@code [Ljava.util.Map$Entry;}".
*
* @param classLoader the class loader to use to load the class
* @param className the class name
* @param initialize whether the class must be initialized
- * @return the class represented by className
using the classLoader
+ * @return the class represented by {@code className} using the {@code classLoader}
* @throws ClassNotFoundException if the class is not found
*/
public static Class> getClass(
@@ -776,15 +776,15 @@ public static Class> getClass(
}
/**
- * Returns the (initialized) class represented by className
- * using the classLoader
. This implementation supports
- * the syntaxes "java.util.Map.Entry[]
",
- * "java.util.Map$Entry[]
", "[Ljava.util.Map.Entry;
",
- * and "[Ljava.util.Map$Entry;
".
+ * Returns the (initialized) class represented by {@code className}
+ * using the {@code classLoader}. This implementation supports
+ * the syntaxes "{@code java.util.Map.Entry[]}",
+ * "{@code java.util.Map$Entry[]}", "{@code [Ljava.util.Map.Entry;}",
+ * and "{@code [Ljava.util.Map$Entry;}".
*
* @param classLoader the class loader to use to load the class
* @param className the class name
- * @return the class represented by className
using the classLoader
+ * @return the class represented by {@code className} using the {@code classLoader}
* @throws ClassNotFoundException if the class is not found
*/
public static Class> getClass(ClassLoader classLoader, String className) throws ClassNotFoundException {
@@ -792,14 +792,14 @@ public static Class> getClass(ClassLoader classLoader, String className) throw
}
/**
- * Returns the (initialized) class represented by className
+ * Returns the (initialized) class represented by {@code className}
* using the current thread's context class loader. This implementation
- * supports the syntaxes "java.util.Map.Entry[]
",
- * "java.util.Map$Entry[]
", "[Ljava.util.Map.Entry;
",
- * and "[Ljava.util.Map$Entry;
".
+ * supports the syntaxes "{@code java.util.Map.Entry[]}",
+ * "{@code java.util.Map$Entry[]}", "{@code [Ljava.util.Map.Entry;}",
+ * and "{@code [Ljava.util.Map$Entry;}".
*
* @param className the class name
- * @return the class represented by className
using the current thread's context class loader
+ * @return the class represented by {@code className} using the current thread's context class loader
* @throws ClassNotFoundException if the class is not found
*/
public static Class> getClass(String className) throws ClassNotFoundException {
@@ -807,14 +807,14 @@ public static Class> getClass(String className) throws ClassNotFoundException
}
/**
- * Returns the class represented by className
using the
+ * Returns the class represented by {@code className} using the
* current thread's context class loader. This implementation supports the
- * syntaxes "java.util.Map.Entry[]
", "java.util.Map$Entry[]
",
- * "[Ljava.util.Map.Entry;
", and "[Ljava.util.Map$Entry;
".
+ * syntaxes "{@code java.util.Map.Entry[]}", "{@code java.util.Map$Entry[]}",
+ * "{@code [Ljava.util.Map.Entry;}", and "{@code [Ljava.util.Map$Entry;}".
*
* @param className the class name
* @param initialize whether the class must be initialized
- * @return the class represented by className
using the current thread's context class loader
+ * @return the class represented by {@code className} using the current thread's context class loader
* @throws ClassNotFoundException if the class is not found
*/
public static Class> getClass(String className, boolean initialize) throws ClassNotFoundException {
@@ -826,7 +826,7 @@ public static Class> getClass(String className, boolean initialize) throws Cla
// Public method
// ----------------------------------------------------------------------
/**
- * Returns the desired Method much like Class.getMethod
, however
+ *
Returns the desired Method much like {@code Class.getMethod}, however
* it ensures that the returned Method is from a public class or interface and not
* from an anonymous inner class. This means that the Method is invokable and
* doesn't fall foul of Java bug
@@ -906,13 +906,13 @@ private static String toCanonicalName(String className) {
}
/**
- *
Converts an array of Object
in to an array of Class
objects.
+ *
Converts an array of {@code Object} in to an array of {@code Class} objects.
* If any of these objects is null, a null element will be inserted into the array.
*
- * This method returns null
for a null
input array.
+ * This method returns {@code null} for a {@code null} input array.
*
- * @param array an Object
array
- * @return a Class
array, null
if null array input
+ * @param array an {@code Object} array
+ * @return a {@code Class} array, {@code null} if null array input
* @since 2.4
*/
public static Class>[] toClass(Object[] array) {
@@ -931,7 +931,7 @@ public static Class>[] toClass(Object[] array) {
// Short canonical name
// ----------------------------------------------------------------------
/**
- * Gets the canonical name minus the package name for an Object
.
+ * Gets the canonical name minus the package name for an {@code Object}.
*
* @param object the class to get the short name for, may be null
* @param valueIfNull the value to return if null
@@ -946,7 +946,7 @@ public static String getShortCanonicalName(Object object, String valueIfNull) {
}
/**
- * Gets the canonical name minus the package name from a Class
.
+ * Gets the canonical name minus the package name from a {@code Class}.
*
* @param cls the class to get the short name for.
* @return the canonical name without the package name or an empty string
@@ -975,7 +975,7 @@ public static String getShortCanonicalName(String canonicalName) {
// Package name
// ----------------------------------------------------------------------
/**
- * Gets the package name from the canonical name of an Object
.
+ * Gets the package name from the canonical name of an {@code Object}.
*
* @param object the class to get the package name for, may be null
* @param valueIfNull the value to return if null
@@ -990,9 +990,9 @@ public static String getPackageCanonicalName(Object object, String valueIfNull)
}
/**
- * Gets the package name from the canonical name of a Class
.
+ * Gets the package name from the canonical name of a {@code Class}.
*
- * @param cls the class to get the package name for, may be null
.
+ * @param cls the class to get the package name for, may be {@code null}.
* @return the package name or an empty string
* @since 2.4
*/
@@ -1009,7 +1009,7 @@ public static String getPackageCanonicalName(Class> cls) {
* The string passed in is assumed to be a canonical name - it is not checked.
* If the class is unpackaged, return an empty string.
*
- * @param canonicalName the canonical name to get the package name for, may be null
+ * @param canonicalName the canonical name to get the package name for, may be {@code null}
* @return the package name or an empty string
* @since 2.4
*/
@@ -1023,9 +1023,9 @@ public static String getPackageCanonicalName(String canonicalName) {
* unchanged name.
* Example:
*
- * getCanonicalName("[I") = "int[]"
- * getCanonicalName("[Ljava.lang.String;") = "java.lang.String[]"
- * getCanonicalName("java.lang.String") = "java.lang.String"
+ * - {@code getCanonicalName("[I") = "int[]"}
+ * - {@code getCanonicalName("[Ljava.lang.String;") = "java.lang.String[]"}
+ * - {@code getCanonicalName("java.lang.String") = "java.lang.String"}
*
*
*
diff --git a/src/main/java/org/apache/commons/lang3/LocaleUtils.java b/src/main/java/org/apache/commons/lang3/LocaleUtils.java
index 464eada6e..c834985b2 100644
--- a/src/main/java/org/apache/commons/lang3/LocaleUtils.java
+++ b/src/main/java/org/apache/commons/lang3/LocaleUtils.java
@@ -29,8 +29,8 @@
/**
* Operations to assist when working with a {@link Locale}.
*
- * This class tries to handle null
input gracefully.
- * An exception will not be thrown for a null
input.
+ *
This class tries to handle {@code null} input gracefully.
+ * An exception will not be thrown for a {@code null} input.
* Each method documents its behaviour in more detail.
*
* @author Apache Software Foundation
@@ -48,8 +48,8 @@ public class LocaleUtils {
new ConcurrentHashMap>();
/**
- * LocaleUtils
instances should NOT be constructed in standard programming.
- * Instead, the class should be used as LocaleUtils.toLocale("en_GB");
.
+ * {@code LocaleUtils} instances should NOT be constructed in standard programming.
+ * Instead, the class should be used as {@code LocaleUtils.toLocale("en_GB");}.
*
* This constructor is public to permit tools that require a JavaBean instance
* to operate.
diff --git a/src/main/java/org/apache/commons/lang3/RandomStringUtils.java b/src/main/java/org/apache/commons/lang3/RandomStringUtils.java
index b143002b4..9ea1cbf3b 100644
--- a/src/main/java/org/apache/commons/lang3/RandomStringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/RandomStringUtils.java
@@ -17,8 +17,9 @@
package org.apache.commons.lang3;
import java.util.Random;
+
/**
- * Operations for random String
s.
+ * Operations for random {@code String}s.
* Currently private high surrogate characters are ignored.
* These are unicode characters that fall between the values 56192 (db80)
* and 56319 (dbff) as we don't know how to handle them.
@@ -46,9 +47,9 @@ public class RandomStringUtils {
private static final Random RANDOM = new Random();
/**
- *
RandomStringUtils
instances should NOT be constructed in
+ *
{@code RandomStringUtils} instances should NOT be constructed in
* standard programming. Instead, the class should be used as
- * RandomStringUtils.random(5);
.
+ * {@code RandomStringUtils.random(5);}.
*
* This constructor is public to permit tools that require a JavaBean instance
* to operate.
@@ -77,7 +78,7 @@ public static String random(int count) {
* specified.
*
* Characters will be chosen from the set of characters whose
- * ASCII value is between 32
and 126
(inclusive).
+ * ASCII value is between {@code 32} and {@code 126} (inclusive).
*
* @param count the length of random string to create
* @return the random string
@@ -136,9 +137,9 @@ public static String randomNumeric(int count) {
* characters as indicated by the arguments.
*
* @param count the length of random string to create
- * @param letters if true
, generated string will include
+ * @param letters if {@code true}, generated string will include
* alphabetic characters
- * @param numbers if true
, generated string will include
+ * @param numbers if {@code true}, generated string will include
* numeric characters
* @return the random string
*/
@@ -156,9 +157,9 @@ public static String random(int count, boolean letters, boolean numbers) {
* @param count the length of random string to create
* @param start the position in set of chars to start at
* @param end the position in set of chars to end before
- * @param letters if true
, generated string will include
+ * @param letters if {@code true}, generated string will include
* alphabetic characters
- * @param numbers if true
, generated string will include
+ * @param numbers if {@code true}, generated string will include
* numeric characters
* @return the random string
*/
@@ -181,10 +182,10 @@ public static String random(int count, int start, int end, boolean letters, bool
* @param letters only allow letters?
* @param numbers only allow numbers?
* @param chars the set of chars to choose randoms from.
- * If null
, then it will use the set of all chars.
+ * If {@code null}, then it will use the set of all chars.
* @return the random string
* @throws ArrayIndexOutOfBoundsException if there are not
- * (end - start) + 1
characters in the set array.
+ * {@code (end - start) + 1} characters in the set array.
*/
public static String random(int count, int start, int end, boolean letters, boolean numbers, char[] chars) {
return random(count, start, end, letters, numbers, chars, RANDOM);
@@ -194,13 +195,13 @@ public static String random(int count, int start, int end, boolean letters, bool
* Creates a random string based on a variety of options, using
* supplied source of randomness.
*
- * If start and end are both 0
, start and end are set
- * to ' '
and 'z'
, the ASCII printable
+ *
If start and end are both {@code 0}, start and end are set
+ * to {@code ' '} and {@code 'z'}, the ASCII printable
* characters, will be used, unless letters and numbers are both
- * false
, in which case, start and end are set to
- * 0
and Integer.MAX_VALUE
.
+ * {@code false}, in which case, start and end are set to
+ * {@code 0} and {@code Integer.MAX_VALUE}.
*
- *
If set is not null
, characters between start and
+ *
If set is not {@code null}, characters between start and
* end are chosen.
*
* This method accepts a user-supplied {@link Random}
@@ -215,12 +216,12 @@ public static String random(int count, int start, int end, boolean letters, bool
* @param letters only allow letters?
* @param numbers only allow numbers?
* @param chars the set of chars to choose randoms from.
- * If null
, then it will use the set of all chars.
+ * If {@code null}, then it will use the set of all chars.
* @param random a source of randomness.
* @return the random string
* @throws ArrayIndexOutOfBoundsException if there are not
- * (end - start) + 1
characters in the set array.
- * @throws IllegalArgumentException if count
< 0.
+ * {@code (end - start) + 1} characters in the set array.
+ * @throws IllegalArgumentException if {@code count} < 0.
* @since 2.0
*/
public static String random(int count, int start, int end, boolean letters, boolean numbers,
@@ -294,7 +295,7 @@ public static String random(int count, int start, int end, boolean letters, bool
* @param chars the String containing the set of characters to use,
* may be null
* @return the random string
- * @throws IllegalArgumentException if count
< 0.
+ * @throws IllegalArgumentException if {@code count} < 0.
*/
public static String random(int count, String chars) {
if (chars == null) {
@@ -313,7 +314,7 @@ public static String random(int count, String chars) {
* @param chars the character array containing the set of characters to use,
* may be null
* @return the random string
- * @throws IllegalArgumentException if count
< 0.
+ * @throws IllegalArgumentException if {@code count} < 0.
*/
public static String random(int count, char[] chars) {
if (chars == null) {
diff --git a/src/main/java/org/apache/commons/lang3/Range.java b/src/main/java/org/apache/commons/lang3/Range.java
index 17d39e3cb..e1a25bd1c 100644
--- a/src/main/java/org/apache/commons/lang3/Range.java
+++ b/src/main/java/org/apache/commons/lang3/Range.java
@@ -20,9 +20,9 @@
import java.util.Comparator;
/**
- *
Range
represents an immutable range of comparables of the same type.
- * The objects need to either be implementations of java.lang.Comparable
- * or you need to supply a java.util.Comparator
.
+ * {@code Range} represents an immutable range of comparables of the same type.
+ * The objects need to either be implementations of {@code java.lang.Comparable}
+ * or you need to supply a {@code java.util.Comparator}.
*
* #ThreadSafe# if the comparables are thread-safe
* @author Apache Software Foundation
@@ -64,14 +64,14 @@ public final class Range implements Serializable {
private transient String toString = null;
/**
- * Constructs a new Range
using the specified
+ *
Constructs a new {@code Range} using the specified
* element as both the minimum and maximum in this range.
* The range uses the natural ordering of the elements to
* determine where values lie in the range.
*
- * @param element the value to use for this range, must not be null
+ * @param element the value to use for this range, must not be {@code null}
* @return the new range object
- * @throws IllegalArgumentException if the value is null
+ * @throws IllegalArgumentException if the value is {@code null}
* @throws ClassCastException if the value is not Comparable
*/
public static > Range is(T element) {
@@ -79,7 +79,7 @@ public static > Range is(T element) {
}
/**
- * Constructs a new Range
with the specified
+ *
Constructs a new {@code Range} with the specified
* minimum and maximum values (both inclusive).
* The range uses the natural ordering of the elements to
* determine where values lie in the range.
@@ -90,7 +90,7 @@ public static > Range is(T element) {
* @param element1 first value that defines the edge of the range, inclusive
* @param element2 second value that defines the edge of the range, inclusive
* @return the new range object
- * @throws IllegalArgumentException if either value is null
+ * @throws IllegalArgumentException if either value is {@code null}
* @throws ClassCastException if either value is not Comparable
*/
public static > Range between(T element1, T element2) {
@@ -98,24 +98,24 @@ public static > Range between(T element1, T element2)
}
/**
- * Constructs a new Range
using the specified
+ *
Constructs a new {@code Range} using the specified
* element as both the minimum and maximum in this range.
- * The range uses the passed in Comparator
to
+ *
The range uses the passed in {@code Comparator} to
* determine where values lie in the range.
*
- * @param element the value to use for this range, must not be null
+ * @param element the value to use for this range, must not be {@code null}
* @param c comparator to be used
* @return the new range object
- * @throws IllegalArgumentException if the value is null
+ * @throws IllegalArgumentException if the value is {@code null}
*/
public static Range is(T element, Comparator c) {
return new Range(element, element, c);
}
/**
- * Constructs a new Range
with the specified
+ *
Constructs a new {@code Range} with the specified
* minimum and maximum values (both inclusive).
- * The range uses the passed in Comparator
to
+ *
The range uses the passed in {@code Comparator} to
* determine where values lie in the range.
*
* The arguments may be passed in the order (min,max) or (max,min). The
@@ -125,7 +125,7 @@ public static Range is(T element, Comparator c) {
* @param element2 second value that defines the edge of the range, inclusive
* @param c comparator to be used
* @return the new range object
- * @throws IllegalArgumentException if either value is null
+ * @throws IllegalArgumentException if either value is {@code null}
*/
public static Range between(T element1, T element2, Comparator c) {
return new Range(element1, element2, c);
@@ -197,10 +197,10 @@ public boolean isDefaultNaturalOrdering() {
/**
* Tests whether the specified element occurs within this range.
*
- * null
is handled and returns false
.
+ * {@code null} is handled and returns {@code false}.
*
- * @param element the element to test, may be null
- * @return true
if the specified element occurs within this range
+ * @param element the element to test, may be {@code null}
+ * @return {@code true} if the specified element occurs within this range
*/
public boolean contains(T element) {
if(element == null) {
@@ -212,10 +212,10 @@ public boolean contains(T element) {
/**
* Tests whether the specified element occurs before this range.
*
- * null
is handled and returns false
.
+ * {@code null} is handled and returns {@code false}.
*
- * @param element the element to test, may be null
- * @return true
if the specified element occurs before this range
+ * @param element the element to test, may be {@code null}
+ * @return {@code true} if the specified element occurs before this range
*/
public boolean elementBefore(T element) {
if (element == null) {
@@ -228,10 +228,10 @@ public boolean elementBefore(T element) {
/**
* Tests whether the specified element occurs after this range.
*
- * null
is handled and returns false
.
+ * {@code null} is handled and returns {@code false}.
*
- * @param element the element to test, may be null
- * @return true
if the specified element occurs after this range
+ * @param element the element to test, may be {@code null}
+ * @return {@code true} if the specified element occurs after this range
*/
public boolean elementAfter(T element) {
if (element == null) {
@@ -243,9 +243,9 @@ public boolean elementAfter(T element) {
/**
* Tests where the specified element occurs relative to this range.
- * The API is reminiscent of the Comparable interface returning -1
if
- * the element is before the range, 0
if contained within the range and
- * 1
if the element is after the range.
+ * The API is reminiscent of the Comparable interface returning {@code -1} if
+ * the element is before the range, {@code 0} if contained within the range and
+ * {@code 1} if the element is after the range.
*
* @param element the element to test
* @return -1, 0 or +1 depending on the element's location relative to the range
@@ -271,12 +271,12 @@ public int elementCompareTo(T element) {
/**
* Tests whether the specified range occurs entirely within this range.
*
- * null
is handled and returns false
.
+ * {@code null} is handled and returns {@code false}.
*
- * @param range the range to test, may be null
- * @return true
if the specified range occurs entirely within
- * this range; otherwise, false
- * @throws IllegalArgumentException if the Range
cannot be compared
+ * @param range the range to test, may be {@code null}
+ * @return {@code true} if the specified range occurs entirely within
+ * this range; otherwise, {@code false}
+ * @throws IllegalArgumentException if the {@code Range} cannot be compared
*/
public boolean containsAll(Range range) {
if (range == null) {
@@ -289,12 +289,12 @@ public boolean containsAll(Range range) {
/**
* Tests whether the specified range overlaps with this range.
*
- * null
is handled and returns false
.
+ * {@code null} is handled and returns {@code false}.
*
- * @param range the range to test, may be null
- * @return true
if the specified range overlaps with this
- * range; otherwise, false
- * @throws IllegalArgumentException if the Range
cannot be compared
+ * @param range the range to test, may be {@code null}
+ * @return {@code true} if the specified range overlaps with this
+ * range; otherwise, {@code false}
+ * @throws IllegalArgumentException if the {@code Range} cannot be compared
*/
public boolean overlapsWith(Range range) {
if (range == null) {
@@ -314,7 +314,7 @@ public boolean overlapsWith(Range range) {
* To be equal, the class, minimum and maximum must be equal.
*
* @param obj the reference object with which to compare
- * @return true
if this object is equal
+ * @return {@code true} if this object is equal
*/
@Override
public boolean equals(Object obj) {
@@ -349,11 +349,11 @@ public int hashCode() {
}
/**
- * Gets the range as a String
.
+ * Gets the range as a {@code String}.
*
* The format of the String is 'Range[min,max]'.
*
- * @return the String
representation of this range
+ * @return the {@code String} representation of this range
*/
@Override
public String toString() {
diff --git a/src/main/java/org/apache/commons/lang3/SerializationException.java b/src/main/java/org/apache/commons/lang3/SerializationException.java
index 9586a483d..97df5205a 100644
--- a/src/main/java/org/apache/commons/lang3/SerializationException.java
+++ b/src/main/java/org/apache/commons/lang3/SerializationException.java
@@ -36,7 +36,7 @@ public class SerializationException extends RuntimeException {
private static final long serialVersionUID = 4029025366392702726L;
/**
- * Constructs a new SerializationException
without specified
+ *
Constructs a new {@code SerializationException} without specified
* detail message.
*/
public SerializationException() {
@@ -44,7 +44,7 @@ public SerializationException() {
}
/**
- * Constructs a new SerializationException
with specified
+ *
Constructs a new {@code SerializationException} with specified
* detail message.
*
* @param msg The error message.
@@ -54,10 +54,10 @@ public SerializationException(String msg) {
}
/**
- * Constructs a new SerializationException
with specified
- * nested Throwable
.
+ * Constructs a new {@code SerializationException} with specified
+ * nested {@code Throwable}.
*
- * @param cause The Exception
or Error
+ * @param cause The {@code Exception} or {@code Error}
* that caused this exception to be thrown.
*/
public SerializationException(Throwable cause) {
@@ -65,11 +65,11 @@ public SerializationException(Throwable cause) {
}
/**
- * Constructs a new SerializationException
with specified
- * detail message and nested Throwable
.
+ * Constructs a new {@code SerializationException} with specified
+ * detail message and nested {@code Throwable}.
*
* @param msg The error message.
- * @param cause The Exception
or Error
+ * @param cause The {@code Exception} or {@code Error}
* that caused this exception to be thrown.
*/
public SerializationException(String msg, Throwable cause) {
diff --git a/src/main/java/org/apache/commons/lang3/SerializationUtils.java b/src/main/java/org/apache/commons/lang3/SerializationUtils.java
index b63725503..ea9bd5e99 100644
--- a/src/main/java/org/apache/commons/lang3/SerializationUtils.java
+++ b/src/main/java/org/apache/commons/lang3/SerializationUtils.java
@@ -35,7 +35,7 @@
* Deserialize managing finally and IOException
*
*
- * This class throws exceptions for invalid null
inputs.
+ *
This class throws exceptions for invalid {@code null} inputs.
* Each method documents its behaviour in more detail.
*
* #ThreadSafe#
@@ -52,7 +52,7 @@ public class SerializationUtils {
/**
* SerializationUtils instances should NOT be constructed in standard programming.
- * Instead, the class should be used as SerializationUtils.clone(object)
.
+ * Instead, the class should be used as {@code SerializationUtils.clone(object)}.
*
* This constructor is public to permit tools that require a JavaBean instance
* to operate.
@@ -65,15 +65,15 @@ public SerializationUtils() {
// Clone
//-----------------------------------------------------------------------
/**
- * Deep clone an Object
using serialization.
+ * Deep clone an {@code Object} using serialization.
*
* This is many times slower than writing clone methods by hand
* on all objects in your object graph. However, for complex object
* graphs, or for those that don't support deep cloning this can
* be a simple alternative implementation. Of course all the objects
- * must be Serializable
.
+ * must be {@code Serializable}.
*
- * @param object the Serializable
object to clone
+ * @param object the {@code Serializable} object to clone
* @return the cloned object
* @throws SerializationException (runtime) if the serialization fails
*/
@@ -91,7 +91,7 @@ public static T clone(T object) {
// Serialize
//-----------------------------------------------------------------------
/**
- * Serializes an Object
to the specified stream.
+ * Serializes an {@code Object} to the specified stream.
*
* The stream will be closed once the object is written.
* This avoids the need for a finally clause, and maybe also exception
@@ -102,7 +102,7 @@ public static T clone(T object) {
*
* @param obj the object to serialize to bytes, may be null
* @param outputStream the stream to write to, must not be null
- * @throws IllegalArgumentException if outputStream
is null
+ * @throws IllegalArgumentException if {@code outputStream} is {@code null}
* @throws SerializationException (runtime) if the serialization fails
*/
public static void serialize(Serializable obj, OutputStream outputStream) {
@@ -129,7 +129,7 @@ public static void serialize(Serializable obj, OutputStream outputStream) {
}
/**
- * Serializes an Object
to a byte array for
+ *
Serializes an {@code Object} to a byte array for
* storage/serialization.
*
* @param obj the object to serialize to bytes
@@ -145,7 +145,7 @@ public static byte[] serialize(Serializable obj) {
// Deserialize
//-----------------------------------------------------------------------
/**
- * Deserializes an Object
from the specified stream.
+ * Deserializes an {@code Object} from the specified stream.
*
* The stream will be closed once the object is written. This
* avoids the need for a finally clause, and maybe also exception
@@ -156,7 +156,7 @@ public static byte[] serialize(Serializable obj) {
*
* @param inputStream the serialized object input stream, must not be null
* @return the deserialized object
- * @throws IllegalArgumentException if inputStream
is null
+ * @throws IllegalArgumentException if {@code inputStream} is {@code null}
* @throws SerializationException (runtime) if the serialization fails
*/
public static Object deserialize(InputStream inputStream) {
@@ -185,11 +185,11 @@ public static Object deserialize(InputStream inputStream) {
}
/**
- *
Deserializes a single Object
from an array of bytes.
+ * Deserializes a single {@code Object} from an array of bytes.
*
* @param objectData the serialized object, must not be null
* @return the deserialized object
- * @throws IllegalArgumentException if objectData
is null
+ * @throws IllegalArgumentException if {@code objectData} is {@code null}
* @throws SerializationException (runtime) if the serialization fails
*/
public static Object deserialize(byte[] objectData) {
diff --git a/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java b/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java
index 8f2ced950..c739ff9b2 100644
--- a/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java
@@ -29,7 +29,7 @@
import org.apache.commons.lang3.text.translate.UnicodeUnescaper;
/**
- * Escapes and unescapes String
s for
+ *
Escapes and unescapes {@code String}s for
* Java, Java Script, HTML and XML.
*
* #ThreadSafe#
@@ -203,7 +203,7 @@ public int translate(CharSequence input, int index, Writer out) throws IOExcepti
/* Helper functions */
/**
- * StringEscapeUtils
instances should NOT be constructed in
+ *
{@code StringEscapeUtils} instances should NOT be constructed in
* standard programming.
*
* Instead, the class should be used as:
@@ -219,12 +219,12 @@ public StringEscapeUtils() {
// Java and JavaScript
//--------------------------------------------------------------------------
/**
- *
Escapes the characters in a String
using Java String rules.
+ * Escapes the characters in a {@code String} using Java String rules.
*
* Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.)
*
- * So a tab becomes the characters '\\'
and
- * 't'
.
+ * So a tab becomes the characters {@code '\\'} and
+ * {@code 't'}.
*
* The only difference between Java strings and JavaScript strings
* is that in JavaScript, a single quote and forward-slash (/) are escaped.
@@ -237,19 +237,19 @@ public StringEscapeUtils() {
*
*
* @param input String to escape values in, may be null
- * @return String with escaped values, null
if null string input
+ * @return String with escaped values, {@code null} if null string input
*/
public static final String escapeJava(String input) {
return ESCAPE_JAVA.translate(input);
}
/**
- * Escapes the characters in a String
using EcmaScript String rules.
+ * Escapes the characters in a {@code String} using EcmaScript String rules.
* Escapes any values it finds into their EcmaScript String form.
* Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.)
*
- * So a tab becomes the characters '\\'
and
- * 't'
.
+ * So a tab becomes the characters {@code '\\'} and
+ * {@code 't'}.
*
* The only difference between Java strings and EcmaScript strings
* is that in EcmaScript, a single quote and forward-slash (/) are escaped.
@@ -264,35 +264,35 @@ public static final String escapeJava(String input) {
*
*
* @param input String to escape values in, may be null
- * @return String with escaped values, null
if null string input
+ * @return String with escaped values, {@code null} if null string input
*/
public static final String escapeEcmaScript(String input) {
return ESCAPE_ECMASCRIPT.translate(input);
}
/**
- * Unescapes any Java literals found in the String
.
- * For example, it will turn a sequence of '\'
and
- * 'n'
into a newline character, unless the '\'
- * is preceded by another '\'
.
+ * Unescapes any Java literals found in the {@code String}.
+ * For example, it will turn a sequence of {@code '\'} and
+ * {@code 'n'} into a newline character, unless the {@code '\'}
+ * is preceded by another {@code '\'}.
*
- * @param input the String
to unescape, may be null
- * @return a new unescaped String
, null
if null string input
+ * @param input the {@code String} to unescape, may be null
+ * @return a new unescaped {@code String}, {@code null} if null string input
*/
public static final String unescapeJava(String input) {
return UNESCAPE_JAVA.translate(input);
}
/**
- * Unescapes any EcmaScript literals found in the String
.
+ * Unescapes any EcmaScript literals found in the {@code String}.
*
- * For example, it will turn a sequence of '\'
and 'n'
- * into a newline character, unless the '\'
is preceded by another
- * '\'
.
+ * For example, it will turn a sequence of {@code '\'} and {@code 'n'}
+ * into a newline character, unless the {@code '\'} is preceded by another
+ * {@code '\'}.
*
* @see #unescapeJava(String)
- * @param input the String
to unescape, may be null
- * @return A new unescaped String
, null
if null string input
+ * @param input the {@code String} to unescape, may be null
+ * @return A new unescaped {@code String}, {@code null} if null string input
*/
public static final String unescapeEcmaScript(String input) {
return UNESCAPE_ECMASCRIPT.translate(input);
@@ -301,7 +301,7 @@ public static final String unescapeEcmaScript(String input) {
// HTML and XML
//--------------------------------------------------------------------------
/**
- * Escapes the characters in a String
using HTML entities.
+ * Escapes the characters in a {@code String} using HTML entities.
*
*
* For example:
@@ -316,8 +316,8 @@ public static final String unescapeEcmaScript(String input) {
* Note that the commonly used apostrophe escape character (')
* is not a legal entity and so is not supported).
*
- * @param input the String
to escape, may be null
- * @return a new escaped String
, null
if null string input
+ * @param input the {@code String} to escape, may be null
+ * @return a new escaped {@code String}, {@code null} if null string input
*
* @see ISO Entities
* @see HTML 3.2 Character Entities for ISO Latin-1
@@ -330,11 +330,11 @@ public static final String escapeHtml4(String input) {
}
/**
- * Escapes the characters in a String
using HTML entities.
+ * Escapes the characters in a {@code String} using HTML entities.
* Supports only the HTML 3.0 entities.
*
- * @param input the String
to escape, may be null
- * @return a new escaped String
, null
if null string input
+ * @param input the {@code String} to escape, may be null
+ * @return a new escaped {@code String}, {@code null} if null string input
*
*/
public static final String escapeHtml3(String input) {
@@ -354,8 +354,8 @@ public static final String escapeHtml3(String input) {
* verbatim into the result string. e.g. ">&zzzz;x" will
* become ">&zzzz;x".
*
- * @param input the String
to unescape, may be null
- * @return a new unescaped String
, null
if null string input
+ * @param input the {@code String} to unescape, may be null
+ * @return a new unescaped {@code String}, {@code null} if null string input
*/
public static final String unescapeHtml4(String input) {
return UNESCAPE_HTML4.translate(input);
@@ -366,8 +366,8 @@ public static final String unescapeHtml4(String input) {
* containing the actual Unicode characters corresponding to the
* escapes. Supports only HTML 3.0 entities.
*
- * @param input the String
to unescape, may be null
- * @return a new unescaped String
, null
if null string input
+ * @param input the {@code String} to unescape, may be null
+ * @return a new unescaped {@code String}, {@code null} if null string input
*/
public static final String unescapeHtml3(String input) {
return UNESCAPE_HTML3.translate(input);
@@ -375,7 +375,7 @@ public static final String unescapeHtml3(String input) {
//-----------------------------------------------------------------------
/**
- * Escapes the characters in a String
using XML entities.
+ * Escapes the characters in a {@code String} using XML entities.
*
* For example: "bread" & "butter" =>
* "bread" & "butter".
@@ -387,8 +387,8 @@ public static final String unescapeHtml3(String input) {
*
Note that unicode characters greater than 0x7f are as of 3.0, no longer
* escaped.
*
- * @param input the String
to escape, may be null
- * @return a new escaped String
, null
if null string input
+ * @param input the {@code String} to escape, may be null
+ * @return a new escaped {@code String}, {@code null} if null string input
* @see #unescapeXml(java.lang.String)
*/
public static final String escapeXml(String input) {
@@ -408,8 +408,8 @@ public static final String escapeXml(String input) {
* Note that numerical \\u unicode codes are unescaped to their respective
* unicode characters. This may change in future releases.
*
- * @param input the String
to unescape, may be null
- * @return a new unescaped String
, null
if null string input
+ * @param input the {@code String} to unescape, may be null
+ * @return a new unescaped {@code String}, {@code null} if null string input
* @see #escapeXml(String)
*/
public static final String unescapeXml(String input) {
@@ -420,7 +420,7 @@ public static final String unescapeXml(String input) {
//-----------------------------------------------------------------------
/**
- * Returns a String
value for a CSV column enclosed in double quotes,
+ *
Returns a {@code String} value for a CSV column enclosed in double quotes,
* if required.
*
* If the value contains a comma, newline or double quote, then the
@@ -438,7 +438,7 @@ public static final String unescapeXml(String input) {
*
* @param input the input CSV column String, may be null
* @return the input String, enclosed in double quotes if the value contains a comma,
- * newline or double quote, null
if null string input
+ * newline or double quote, {@code null} if null string input
* @since 2.4
*/
public static final String escapeCsv(String input) {
@@ -446,7 +446,7 @@ public static final String escapeCsv(String input) {
}
/**
- *
Returns a String
value for an unescaped CSV column.
+ * Returns a {@code String} value for an unescaped CSV column.
*
* If the value is enclosed in double quotes, and contains a comma, newline
* or double quote, then quotes are removed.
@@ -464,7 +464,7 @@ public static final String escapeCsv(String input) {
*
* @param input the input CSV column String, may be null
* @return the input String, with enclosing double quotes removed and embedded double
- * quotes unescaped, null
if null string input
+ * quotes unescaped, {@code null} if null string input
* @since 2.4
*/
public static final String unescapeCsv(String input) {
diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java
index b8edc2e16..767184749 100644
--- a/src/main/java/org/apache/commons/lang3/StringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringUtils.java
@@ -26,7 +26,7 @@
/**
*
Operations on {@link java.lang.String} that are
- * null
safe.
+ * {@code null} safe.
*
*
* - IsEmpty/IsBlank
@@ -77,28 +77,28 @@
* - the number of changes needed to change one String into another
*
*
- * The StringUtils
class defines certain words related to
+ *
The {@code StringUtils} class defines certain words related to
* String handling.
*
*
- * - null -
null
- * - empty - a zero-length string (
""
)
- * - space - the space character (
' '
, char 32)
+ * - null - {@code null}
+ * - empty - a zero-length string ({@code ""})
+ * - space - the space character ({@code ' '}, char 32)
* - whitespace - the characters defined by {@link Character#isWhitespace(char)}
* - trim - the characters <= 32 as in {@link String#trim()}
*
*
- * StringUtils
handles null
input Strings quietly.
- * That is to say that a null
input will return null
.
- * Where a boolean
or int
is being returned
+ *
{@code StringUtils} handles {@code null} input Strings quietly.
+ * That is to say that a {@code null} input will return {@code null}.
+ * Where a {@code boolean} or {@code int} is being returned
* details vary by method.
*
- * A side effect of the null
handling is that a
- * NullPointerException
should be considered a bug in
- * StringUtils
.
+ * A side effect of the {@code null} handling is that a
+ * {@code NullPointerException} should be considered a bug in
+ * {@code StringUtils}.
*
* Methods in this class give sample code to explain their operation.
- * The symbol *
is used to indicate any input including null
.
+ * The symbol {@code *} is used to indicate any input including {@code null}.
*
* #ThreadSafe#
* @see java.lang.String
@@ -143,7 +143,7 @@ public class StringUtils {
// (not sure who tested this)
/**
- * The empty String ""
.
+ * The empty String {@code ""}.
* @since 2.0
*/
public static final String EMPTY = "";
@@ -165,9 +165,9 @@ public class StringUtils {
private static final Pattern WHITESPACE_BLOCK = Pattern.compile("\\s+");
/**
- * StringUtils
instances should NOT be constructed in
+ *
{@code StringUtils} instances should NOT be constructed in
* standard programming. Instead, the class should be used as
- * StringUtils.trim(" foo ");
.
+ * {@code StringUtils.trim(" foo ");}.
*
* This constructor is public to permit tools that require a JavaBean
* instance to operate.
@@ -194,7 +194,7 @@ public StringUtils() {
* That functionality is available in isBlank().
*
* @param cs the CharSequence to check, may be null
- * @return true
if the CharSequence is empty or null
+ * @return {@code true} if the CharSequence is empty or null
* @since 3.0 Changed signature from isEmpty(String) to isEmpty(CharSequence)
*/
public static boolean isEmpty(CharSequence cs) {
@@ -213,7 +213,7 @@ public static boolean isEmpty(CharSequence cs) {
*
*
* @param cs the CharSequence to check, may be null
- * @return true
if the CharSequence is not empty and not null
+ * @return {@code true} if the CharSequence is not empty and not null
* @since 3.0 Changed signature from isNotEmpty(String) to isNotEmpty(CharSequence)
*/
public static boolean isNotEmpty(CharSequence cs) {
@@ -232,7 +232,7 @@ public static boolean isNotEmpty(CharSequence cs) {
*
*
* @param cs the CharSequence to check, may be null
- * @return true
if the CharSequence is null, empty or whitespace
+ * @return {@code true} if the CharSequence is null, empty or whitespace
* @since 2.0
* @since 3.0 Changed signature from isBlank(String) to isBlank(CharSequence)
*/
@@ -261,7 +261,7 @@ public static boolean isBlank(CharSequence cs) {
*
*
* @param cs the CharSequence to check, may be null
- * @return true
if the CharSequence is
+ * @return {@code true} if the CharSequence is
* not empty and not null and not whitespace
* @since 2.0
* @since 3.0 Changed signature from isNotBlank(String) to isNotBlank(CharSequence)
@@ -274,8 +274,8 @@ public static boolean isNotBlank(CharSequence cs) {
//-----------------------------------------------------------------------
/**
* Removes control characters (char <= 32) from both
- * ends of this String, handling null
by returning
- * null
.
+ * ends of this String, handling {@code null} by returning
+ * {@code null}.
*
* The String is trimmed using {@link String#trim()}.
* Trim removes start and end characters <= 32.
@@ -293,7 +293,7 @@ public static boolean isNotBlank(CharSequence cs) {
*
*
* @param str the String to be trimmed, may be null
- * @return the trimmed string, null
if null String input
+ * @return the trimmed string, {@code null} if null String input
*/
public static String trim(String str) {
return str == null ? null : str.trim();
@@ -301,8 +301,8 @@ public static String trim(String str) {
/**
* Removes control characters (char <= 32) from both
- * ends of this String returning null
if the String is
- * empty ("") after the trim or if it is null
.
+ * ends of this String returning {@code null} if the String is
+ * empty ("") after the trim or if it is {@code null}.
*
*
The String is trimmed using {@link String#trim()}.
* Trim removes start and end characters <= 32.
@@ -318,7 +318,7 @@ public static String trim(String str) {
*
* @param str the String to be trimmed, may be null
* @return the trimmed String,
- * null
if only chars <= 32, empty or null String input
+ * {@code null} if only chars <= 32, empty or null String input
* @since 2.0
*/
public static String trimToNull(String str) {
@@ -329,7 +329,7 @@ public static String trimToNull(String str) {
/**
*
Removes control characters (char <= 32) from both
* ends of this String returning an empty String ("") if the String
- * is empty ("") after the trim or if it is null
.
+ * is empty ("") after the trim or if it is {@code null}.
*
*
The String is trimmed using {@link String#trim()}.
* Trim removes start and end characters <= 32.
@@ -344,7 +344,7 @@ public static String trimToNull(String str) {
*
*
* @param str the String to be trimmed, may be null
- * @return the trimmed String, or an empty String if null
input
+ * @return the trimmed String, or an empty String if {@code null} input
* @since 2.0
*/
public static String trimToEmpty(String str) {
@@ -359,7 +359,7 @@ public static String trimToEmpty(String str) {
*
This is similar to {@link #trim(String)} but removes whitespace.
* Whitespace is defined by {@link Character#isWhitespace(char)}.
*
- * A null
input String returns null
.
+ * A {@code null} input String returns {@code null}.
*
*
* StringUtils.strip(null) = null
@@ -373,7 +373,7 @@ public static String trimToEmpty(String str) {
*
*
* @param str the String to remove whitespace from, may be null
- * @return the stripped String, null
if null String input
+ * @return the stripped String, {@code null} if null String input
*/
public static String strip(String str) {
return strip(str, null);
@@ -381,7 +381,7 @@ public static String strip(String str) {
/**
* Strips whitespace from the start and end of a String returning
- * null
if the String is empty ("") after the strip.
+ * {@code null} if the String is empty ("") after the strip.
*
* This is similar to {@link #trimToNull(String)} but removes whitespace.
* Whitespace is defined by {@link Character#isWhitespace(char)}.
@@ -399,7 +399,7 @@ public static String strip(String str) {
*
* @param str the String to be stripped, may be null
* @return the stripped String,
- * null
if whitespace, empty or null String input
+ * {@code null} if whitespace, empty or null String input
* @since 2.0
*/
public static String stripToNull(String str) {
@@ -412,7 +412,7 @@ public static String stripToNull(String str) {
/**
* Strips whitespace from the start and end of a String returning
- * an empty String if null
input.
+ * an empty String if {@code null} input.
*
* This is similar to {@link #trimToEmpty(String)} but removes whitespace.
* Whitespace is defined by {@link Character#isWhitespace(char)}.
@@ -429,7 +429,7 @@ public static String stripToNull(String str) {
*
*
* @param str the String to be stripped, may be null
- * @return the trimmed String, or an empty String if null
input
+ * @return the trimmed String, or an empty String if {@code null} input
* @since 2.0
*/
public static String stripToEmpty(String str) {
@@ -441,10 +441,10 @@ public static String stripToEmpty(String str) {
* This is similar to {@link String#trim()} but allows the characters
* to be stripped to be controlled.
*
- * A null
input String returns null
.
+ *
A {@code null} input String returns {@code null}.
* An empty string ("") input returns the empty string.
*
- * If the stripChars String is null
, whitespace is
+ *
If the stripChars String is {@code null}, whitespace is
* stripped as defined by {@link Character#isWhitespace(char)}.
* Alternatively use {@link #strip(String)}.
*
@@ -460,7 +460,7 @@ public static String stripToEmpty(String str) {
*
* @param str the String to remove characters from, may be null
* @param stripChars the characters to remove, null treated as whitespace
- * @return the stripped String, null
if null String input
+ * @return the stripped String, {@code null} if null String input
*/
public static String strip(String str, String stripChars) {
if (isEmpty(str)) {
@@ -473,10 +473,10 @@ public static String strip(String str, String stripChars) {
/**
* Strips any of a set of characters from the start of a String.
*
- * A null
input String returns null
.
+ *
A {@code null} input String returns {@code null}.
* An empty string ("") input returns the empty string.
*
- * If the stripChars String is null
, whitespace is
+ *
If the stripChars String is {@code null}, whitespace is
* stripped as defined by {@link Character#isWhitespace(char)}.
*
*
@@ -492,7 +492,7 @@ public static String strip(String str, String stripChars) {
*
* @param str the String to remove characters from, may be null
* @param stripChars the characters to remove, null treated as whitespace
- * @return the stripped String, null
if null String input
+ * @return the stripped String, {@code null} if null String input
*/
public static String stripStart(String str, String stripChars) {
int strLen;
@@ -517,10 +517,10 @@ public static String stripStart(String str, String stripChars) {
/**
* Strips any of a set of characters from the end of a String.
*
- * A null
input String returns null
.
+ *
A {@code null} input String returns {@code null}.
* An empty string ("") input returns the empty string.
*
- * If the stripChars String is null
, whitespace is
+ *
If the stripChars String is {@code null}, whitespace is
* stripped as defined by {@link Character#isWhitespace(char)}.
*
*
@@ -537,7 +537,7 @@ public static String stripStart(String str, String stripChars) {
*
* @param str the String to remove characters from, may be null
* @param stripChars the set of characters to remove, null treated as whitespace
- * @return the stripped String, null
if null String input
+ * @return the stripped String, {@code null} if null String input
*/
public static String stripEnd(String str, String stripChars) {
int end;
@@ -566,9 +566,9 @@ public static String stripEnd(String str, String stripChars) {
* Whitespace is defined by {@link Character#isWhitespace(char)}.
*
* A new array is returned each time, except for length zero.
- * A null
array will return null
.
+ * A {@code null} array will return {@code null}.
* An empty array will return itself.
- * A null
array entry will be ignored.
+ * A {@code null} array entry will be ignored.
*
*
* StringUtils.stripAll(null) = null
@@ -578,7 +578,7 @@ public static String stripEnd(String str, String stripChars) {
*
*
* @param strs the array to remove whitespace from, may be null
- * @return the stripped Strings, null
if null array input
+ * @return the stripped Strings, {@code null} if null array input
*/
public static String[] stripAll(String[] strs) {
return stripAll(strs, null);
@@ -590,10 +590,10 @@ public static String[] stripAll(String[] strs) {
* Whitespace is defined by {@link Character#isWhitespace(char)}.
*
* A new array is returned each time, except for length zero.
- * A null
array will return null
.
+ * A {@code null} array will return {@code null}.
* An empty array will return itself.
- * A null
array entry will be ignored.
- * A null
stripChars will strip whitespace as defined by
+ * A {@code null} array entry will be ignored.
+ * A {@code null} stripChars will strip whitespace as defined by
* {@link Character#isWhitespace(char)}.
*
*
@@ -607,7 +607,7 @@ public static String[] stripAll(String[] strs) {
*
* @param strs the array to remove characters from, may be null
* @param stripChars the characters to remove, null treated as whitespace
- * @return the stripped Strings, null
if null array input
+ * @return the stripped Strings, {@code null} if null array input
*/
public static String[] stripAll(String[] strs, String stripChars) {
int strsLen;
@@ -748,9 +748,9 @@ private static String removeAccentsSUN(CharSequence text) throws IllegalArgument
// Equals
//-----------------------------------------------------------------------
/**
- * Compares two CharSequences, returning true
if they are equal.
+ * Compares two CharSequences, returning {@code true} if they are equal.
*
- * null
s are handled without exceptions. Two null
+ *
{@code null}s are handled without exceptions. Two {@code null}
* references are considered to be equal. The comparison is case sensitive.
*
*
@@ -764,8 +764,8 @@ private static String removeAccentsSUN(CharSequence text) throws IllegalArgument
* @see java.lang.String#equals(Object)
* @param cs1 the first CharSequence, may be null
* @param cs2 the second CharSequence, may be null
- * @return true
if the CharSequences are equal, case sensitive, or
- * both null
+ * @return {@code true} if the CharSequences are equal, case sensitive, or
+ * both {@code null}
* @since 3.0 Changed signature from equals(String, String) to equals(CharSequence, CharSequence)
*/
public static boolean equals(CharSequence cs1, CharSequence cs2) {
@@ -773,10 +773,10 @@ public static boolean equals(CharSequence cs1, CharSequence cs2) {
}
/**
- * Compares two Strings, returning true
if they are equal ignoring
+ *
Compares two Strings, returning {@code true} if they are equal ignoring
* the case.
*
- * null
s are handled without exceptions. Two null
+ *
{@code null}s are handled without exceptions. Two {@code null}
* references are considered equal. Comparison is case insensitive.
*
*
@@ -790,8 +790,8 @@ public static boolean equals(CharSequence cs1, CharSequence cs2) {
* @see java.lang.String#equalsIgnoreCase(String)
* @param str1 the first String, may be null
* @param str2 the second String, may be null
- * @return true
if the Strings are equal, case insensitive, or
- * both null
+ * @return {@code true} if the Strings are equal, case insensitive, or
+ * both {@code null}
*/
public static boolean equalsIgnoreCase(String str1, String str2) {
return str1 == null ? str2 == null : str1.equalsIgnoreCase(str2);
@@ -800,10 +800,10 @@ public static boolean equalsIgnoreCase(String str1, String str2) {
// IndexOf
//-----------------------------------------------------------------------
/**
- * Finds the first index within a String, handling null
.
+ *
Finds the first index within a String, handling {@code null}.
* This method uses {@link String#indexOf(int)}.
*
- * A null
or empty ("") String will return INDEX_NOT_FOUND (-1)
.
+ * A {@code null} or empty ("") String will return {@code INDEX_NOT_FOUND (-1)}.
*
*
* StringUtils.indexOf(null, *) = -1
@@ -815,7 +815,7 @@ public static boolean equalsIgnoreCase(String str1, String str2) {
* @param str the String to check, may be null
* @param searchChar the character to find
* @return the first index of the search character,
- * -1 if no match or null
string input
+ * -1 if no match or {@code null} string input
* @since 2.0
*/
public static int indexOf(String str, int searchChar) {
@@ -827,12 +827,12 @@ public static int indexOf(String str, int searchChar) {
/**
* Finds the first index within a String from a start position,
- * handling null
.
+ * handling {@code null}.
* This method uses {@link String#indexOf(int, int)}.
*
- * A null
or empty ("") String will return (INDEX_NOT_FOUND) -1
.
+ *
A {@code null} or empty ("") String will return {@code (INDEX_NOT_FOUND) -1}.
* A negative start position is treated as zero.
- * A start position greater than the string length returns -1
.
+ * A start position greater than the string length returns {@code -1}.
*
*
* StringUtils.indexOf(null, *, *) = -1
@@ -847,7 +847,7 @@ public static int indexOf(String str, int searchChar) {
* @param searchChar the character to find
* @param startPos the start position, negative treated as zero
* @return the first index of the search character,
- * -1 if no match or null
string input
+ * -1 if no match or {@code null} string input
* @since 2.0
*/
public static int indexOf(String str, int searchChar, int startPos) {
@@ -858,10 +858,10 @@ public static int indexOf(String str, int searchChar, int startPos) {
}
/**
- * Finds the first index within a String, handling null
.
+ *
Finds the first index within a String, handling {@code null}.
* This method uses {@link String#indexOf(String)}.
*
- * A null
String will return -1
.
+ * A {@code null} String will return {@code -1}.
*
*
* StringUtils.indexOf(null, *) = -1
@@ -877,7 +877,7 @@ public static int indexOf(String str, int searchChar, int startPos) {
* @param str the String to check, may be null
* @param searchStr the String to find, may be null
* @return the first index of the search String,
- * -1 if no match or null
string input
+ * -1 if no match or {@code null} string input
* @since 2.0
*/
public static int indexOf(String str, String searchStr) {
@@ -888,10 +888,10 @@ public static int indexOf(String str, String searchStr) {
}
/**
- * Finds the first index within a String, handling null
.
+ *
Finds the first index within a String, handling {@code null}.
* This method uses {@link String#indexOf(String, int)}.
*
- * A null
String will return -1
.
+ *
A {@code null} String will return {@code -1}.
* A negative start position is treated as zero.
* An empty ("") search String always matches.
* A start position greater than the string length only matches
@@ -916,7 +916,7 @@ public static int indexOf(String str, String searchStr) {
* @param searchStr the String to find, may be null
* @param startPos the start position, negative treated as zero
* @return the first index of the search String,
- * -1 if no match or null
string input
+ * -1 if no match or {@code null} string input
* @since 2.0
*/
public static int indexOf(String str, String searchStr, int startPos) {
@@ -927,10 +927,10 @@ public static int indexOf(String str, String searchStr, int startPos) {
}
/**
- *
Finds the n-th index within a String, handling null
.
+ *
Finds the n-th index within a String, handling {@code null}.
* This method uses {@link String#indexOf(String)}.
*
- * A null
String will return -1
.
+ * A {@code null} String will return {@code -1}.
*
*
* StringUtils.ordinalIndexOf(null, *, *) = -1
@@ -954,9 +954,9 @@ public static int indexOf(String str, String searchStr, int startPos) {
*
* @param str the String to check, may be null
* @param searchStr the String to find, may be null
- * @param ordinal the n-th searchStr
to find
+ * @param ordinal the n-th {@code searchStr} to find
* @return the n-th index of the search String,
- * -1
(INDEX_NOT_FOUND
) if no match or null
string input
+ * {@code -1} ({@code INDEX_NOT_FOUND}) if no match or {@code null} string input
* @since 2.1
*/
public static int ordinalIndexOf(String str, String searchStr, int ordinal) {
@@ -964,17 +964,17 @@ public static int ordinalIndexOf(String str, String searchStr, int ordinal) {
}
/**
- * Finds the n-th index within a String, handling null
.
+ *
Finds the n-th index within a String, handling {@code null}.
* This method uses {@link String#indexOf(String)}.
*
- * A null
String will return -1
.
+ * A {@code null} String will return {@code -1}.
*
* @param str the String to check, may be null
* @param searchStr the String to find, may be null
- * @param ordinal the n-th searchStr
to find
+ * @param ordinal the n-th {@code searchStr} to find
* @param lastIndex true if lastOrdinalIndexOf() otherwise false if ordinalIndexOf()
* @return the n-th index of the search String,
- * -1
(INDEX_NOT_FOUND
) if no match or null
string input
+ * {@code -1} ({@code INDEX_NOT_FOUND}) if no match or {@code null} string input
*/
// Shared code between ordinalIndexOf(String,String,int) and lastOrdinalIndexOf(String,String,int)
private static int ordinalIndexOf(String str, String searchStr, int ordinal, boolean lastIndex) {
@@ -1003,7 +1003,7 @@ private static int ordinalIndexOf(String str, String searchStr, int ordinal, boo
/**
* Case in-sensitive find of the first index within a String.
*
- * A null
String will return -1
.
+ *
A {@code null} String will return {@code -1}.
* A negative start position is treated as zero.
* An empty ("") search String always matches.
* A start position greater than the string length only matches
@@ -1021,7 +1021,7 @@ private static int ordinalIndexOf(String str, String searchStr, int ordinal, boo
* @param str the String to check, may be null
* @param searchStr the String to find, may be null
* @return the first index of the search String,
- * -1 if no match or null
string input
+ * -1 if no match or {@code null} string input
* @since 2.5
*/
public static int indexOfIgnoreCase(String str, String searchStr) {
@@ -1032,7 +1032,7 @@ public static int indexOfIgnoreCase(String str, String searchStr) {
*
Case in-sensitive find of the first index within a String
* from the specified position.
*
- * A null
String will return -1
.
+ *
A {@code null} String will return {@code -1}.
* A negative start position is treated as zero.
* An empty ("") search String always matches.
* A start position greater than the string length only matches
@@ -1056,7 +1056,7 @@ public static int indexOfIgnoreCase(String str, String searchStr) {
* @param searchStr the String to find, may be null
* @param startPos the start position, negative treated as zero
* @return the first index of the search String,
- * -1 if no match or null
string input
+ * -1 if no match or {@code null} string input
* @since 2.5
*/
public static int indexOfIgnoreCase(String str, String searchStr, int startPos) {
@@ -1084,10 +1084,10 @@ public static int indexOfIgnoreCase(String str, String searchStr, int startPos)
// LastIndexOf
//-----------------------------------------------------------------------
/**
- *
Finds the last index within a String, handling null
.
+ *
Finds the last index within a String, handling {@code null}.
* This method uses {@link String#lastIndexOf(int)}.
*
- * A null
or empty ("") String will return -1
.
+ * A {@code null} or empty ("") String will return {@code -1}.
*
*
* StringUtils.lastIndexOf(null, *) = -1
@@ -1099,7 +1099,7 @@ public static int indexOfIgnoreCase(String str, String searchStr, int startPos)
* @param str the String to check, may be null
* @param searchChar the character to find
* @return the last index of the search character,
- * -1 if no match or null
string input
+ * -1 if no match or {@code null} string input
* @since 2.0
*/
public static int lastIndexOf(String str, int searchChar) {
@@ -1111,11 +1111,11 @@ public static int lastIndexOf(String str, int searchChar) {
/**
* Finds the last index within a String from a start position,
- * handling null
.
+ * handling {@code null}.
* This method uses {@link String#lastIndexOf(int, int)}.
*
- * A null
or empty ("") String will return -1
.
- * A negative start position returns -1
.
+ *
A {@code null} or empty ("") String will return {@code -1}.
+ * A negative start position returns {@code -1}.
* A start position greater than the string length searches the whole string.
*
*
@@ -1133,7 +1133,7 @@ public static int lastIndexOf(String str, int searchChar) {
* @param searchChar the character to find
* @param startPos the start position
* @return the last index of the search character,
- * -1 if no match or null
string input
+ * -1 if no match or {@code null} string input
* @since 2.0
*/
public static int lastIndexOf(String str, int searchChar, int startPos) {
@@ -1144,10 +1144,10 @@ public static int lastIndexOf(String str, int searchChar, int startPos) {
}
/**
- * Finds the last index within a String, handling null
.
+ *
Finds the last index within a String, handling {@code null}.
* This method uses {@link String#lastIndexOf(String)}.
*
- * A null
String will return -1
.
+ * A {@code null} String will return {@code -1}.
*
*
* StringUtils.lastIndexOf(null, *) = -1
@@ -1162,7 +1162,7 @@ public static int lastIndexOf(String str, int searchChar, int startPos) {
* @param str the String to check, may be null
* @param searchStr the String to find, may be null
* @return the last index of the search String,
- * -1 if no match or null
string input
+ * -1 if no match or {@code null} string input
* @since 2.0
*/
public static int lastIndexOf(String str, String searchStr) {
@@ -1173,10 +1173,10 @@ public static int lastIndexOf(String str, String searchStr) {
}
/**
- * Finds the n-th last index within a String, handling null
.
+ *
Finds the n-th last index within a String, handling {@code null}.
* This method uses {@link String#lastIndexOf(String)}.
*
- * A null
String will return -1
.
+ * A {@code null} String will return {@code -1}.
*
*
* StringUtils.lastOrdinalIndexOf(null, *, *) = -1
@@ -1200,9 +1200,9 @@ public static int lastIndexOf(String str, String searchStr) {
*
* @param str the String to check, may be null
* @param searchStr the String to find, may be null
- * @param ordinal the n-th last searchStr
to find
+ * @param ordinal the n-th last {@code searchStr} to find
* @return the n-th last index of the search String,
- * -1
(INDEX_NOT_FOUND
) if no match or null
string input
+ * {@code -1} ({@code INDEX_NOT_FOUND}) if no match or {@code null} string input
* @since 2.5
*/
public static int lastOrdinalIndexOf(String str, String searchStr, int ordinal) {
@@ -1210,11 +1210,11 @@ public static int lastOrdinalIndexOf(String str, String searchStr, int ordinal)
}
/**
- * Finds the first index within a String, handling null
.
+ *
Finds the first index within a String, handling {@code null}.
* This method uses {@link String#lastIndexOf(String, int)}.
*
- * A null
String will return -1
.
- * A negative start position returns -1
.
+ *
A {@code null} String will return {@code -1}.
+ * A negative start position returns {@code -1}.
* An empty ("") search String always matches unless the start position is negative.
* A start position greater than the string length searches the whole string.
*
@@ -1234,7 +1234,7 @@ public static int lastOrdinalIndexOf(String str, String searchStr, int ordinal)
* @param searchStr the String to find, may be null
* @param startPos the start position, negative treated as zero
* @return the first index of the search String,
- * -1 if no match or null
string input
+ * -1 if no match or {@code null} string input
* @since 2.0
*/
public static int lastIndexOf(String str, String searchStr, int startPos) {
@@ -1247,8 +1247,8 @@ public static int lastIndexOf(String str, String searchStr, int startPos) {
/**
* Case in-sensitive find of the last index within a String.
*
- * A null
String will return -1
.
- * A negative start position returns -1
.
+ *
A {@code null} String will return {@code -1}.
+ * A negative start position returns {@code -1}.
* An empty ("") search String always matches unless the start position is negative.
* A start position greater than the string length searches the whole string.
*
@@ -1263,7 +1263,7 @@ public static int lastIndexOf(String str, String searchStr, int startPos) {
* @param str the String to check, may be null
* @param searchStr the String to find, may be null
* @return the first index of the search String,
- * -1 if no match or null
string input
+ * -1 if no match or {@code null} string input
* @since 2.5
*/
public static int lastIndexOfIgnoreCase(String str, String searchStr) {
@@ -1277,8 +1277,8 @@ public static int lastIndexOfIgnoreCase(String str, String searchStr) {
* Case in-sensitive find of the last index within a String
* from the specified position.
*
- * A null
String will return -1
.
- * A negative start position returns -1
.
+ *
A {@code null} String will return {@code -1}.
+ * A negative start position returns {@code -1}.
* An empty ("") search String always matches unless the start position is negative.
* A start position greater than the string length searches the whole string.
*
@@ -1298,7 +1298,7 @@ public static int lastIndexOfIgnoreCase(String str, String searchStr) {
* @param searchStr the String to find, may be null
* @param startPos the start position
* @return the first index of the search String,
- * -1 if no match or null
string input
+ * -1 if no match or {@code null} string input
* @since 2.5
*/
public static int lastIndexOfIgnoreCase(String str, String searchStr, int startPos) {
@@ -1326,10 +1326,10 @@ public static int lastIndexOfIgnoreCase(String str, String searchStr, int startP
// Contains
//-----------------------------------------------------------------------
/**
- * Checks if String contains a search character, handling null
.
+ *
Checks if String contains a search character, handling {@code null}.
* This method uses {@link String#indexOf(int)}.
*
- * A null
or empty ("") String will return false
.
+ * A {@code null} or empty ("") String will return {@code false}.
*
*
* StringUtils.contains(null, *) = false
@@ -1341,7 +1341,7 @@ public static int lastIndexOfIgnoreCase(String str, String searchStr, int startP
* @param str the String to check, may be null
* @param searchChar the character to find
* @return true if the String contains the search character,
- * false if not or null
string input
+ * false if not or {@code null} string input
* @since 2.0
*/
public static boolean contains(String str, int searchChar) {
@@ -1352,10 +1352,10 @@ public static boolean contains(String str, int searchChar) {
}
/**
- * Checks if String contains a search String, handling null
.
+ *
Checks if String contains a search String, handling {@code null}.
* This method uses {@link String#indexOf(String)}.
*
- * A null
String will return false
.
+ * A {@code null} String will return {@code false}.
*
*
* StringUtils.contains(null, *) = false
@@ -1369,7 +1369,7 @@ public static boolean contains(String str, int searchChar) {
* @param str the String to check, may be null
* @param searchStr the String to find, may be null
* @return true if the String contains the search String,
- * false if not or null
string input
+ * false if not or {@code null} string input
* @since 2.0
*/
public static boolean contains(String str, String searchStr) {
@@ -1381,10 +1381,10 @@ public static boolean contains(String str, String searchStr) {
/**
* Checks if String contains a search String irrespective of case,
- * handling null
. Case-insensitivity is defined as by
+ * handling {@code null}. Case-insensitivity is defined as by
* {@link String#equalsIgnoreCase(String)}.
*
- *
A null
String will return false
.
+ * A {@code null} String will return {@code false}.
*
*
* StringUtils.contains(null, *) = false
@@ -1400,7 +1400,7 @@ public static boolean contains(String str, String searchStr) {
* @param str the String to check, may be null
* @param searchStr the String to find, may be null
* @return true if the String contains the search String irrespective of
- * case or false if not or null
string input
+ * case or false if not or {@code null} string input
*/
public static boolean containsIgnoreCase(String str, String searchStr) {
if (str == null || searchStr == null) {
@@ -1418,8 +1418,8 @@ public static boolean containsIgnoreCase(String str, String searchStr) {
/**
* Check whether the given String contains any whitespace characters.
- * @param str the String to check (may be null
)
- * @return true
if the String is not empty and
+ * @param str the String to check (may be {@code null})
+ * @return {@code true} if the String is not empty and
* contains at least 1 whitespace character
* @see java.lang.Character#isWhitespace
* @since 3.0
@@ -1444,8 +1444,8 @@ public static boolean containsWhitespace(String str) {
* Search a CharSequence to find the first index of any
* character in the given set of characters.
*
- * A null
String will return -1
.
- * A null
or zero length search array will return -1
.
+ * A {@code null} String will return {@code -1}.
+ * A {@code null} or zero length search array will return {@code -1}.
*
*
* StringUtils.indexOfAny(null, *) = -1
@@ -1493,8 +1493,8 @@ public static int indexOfAny(CharSequence cs, char[] searchChars) {
* Search a CharSequence to find the first index of any
* character in the given set of characters.
*
- * A null
String will return -1
.
- * A null
search string will return -1
.
+ * A {@code null} String will return {@code -1}.
+ * A {@code null} search string will return {@code -1}.
*
*
* StringUtils.indexOfAny(null, *) = -1
@@ -1525,8 +1525,8 @@ public static int indexOfAny(CharSequence cs, String searchChars) {
* Checks if the CharSequence contains any character in the given
* set of characters.
*
- * A null
CharSequence will return false
.
- * A null
or zero length search array will return false
.
+ * A {@code null} CharSequence will return {@code false}.
+ * A {@code null} or zero length search array will return {@code false}.
*
*
* StringUtils.containsAny(null, *) = false
@@ -1540,8 +1540,8 @@ public static int indexOfAny(CharSequence cs, String searchChars) {
*
* @param cs the CharSequence to check, may be null
* @param searchChars the chars to search for, may be null
- * @return the true
if any of the chars are found,
- * false
if no match or null input
+ * @return the {@code true} if any of the chars are found,
+ * {@code false} if no match or null input
* @since 2.4
*/
public static boolean containsAny(String cs, char[] searchChars) {
@@ -1580,8 +1580,8 @@ public static boolean containsAny(String cs, char[] searchChars) {
*
*
*
- * A null
CharSequence will return false
. A null
search CharSequence will return
- * false
.
+ * A {@code null} CharSequence will return {@code false}. A {@code null} search CharSequence will return
+ * {@code false}.
*
*
*
@@ -1598,7 +1598,7 @@ public static boolean containsAny(String cs, char[] searchChars) {
* the CharSequence to check, may be null
* @param searchChars
* the chars to search for, may be null
- * @return the true
if any of the chars are found, false
if no match or null input
+ * @return the {@code true} if any of the chars are found, {@code false} if no match or null input
* @since 2.4
*/
public static boolean containsAny(String cs, String searchChars) {
@@ -1614,8 +1614,8 @@ public static boolean containsAny(String cs, String searchChars) {
* Searches a CharSequence to find the first index of any
* character not in the given set of characters.
*
- * A null
CharSequence will return -1
.
- * A null
or zero length search array will return -1
.
+ * A {@code null} CharSequence will return {@code -1}.
+ * A {@code null} or zero length search array will return {@code -1}.
*
*
* StringUtils.indexOfAnyBut(null, *) = -1
@@ -1665,8 +1665,8 @@ public static int indexOfAnyBut(CharSequence cs, char[] searchChars) {
* Search a String to find the first index of any
* character not in the given set of characters.
*
- * A null
String will return -1
.
- * A null
or empty search string will return -1
.
+ * A {@code null} String will return {@code -1}.
+ * A {@code null} or empty search string will return {@code -1}.
*
*
* StringUtils.indexOfAnyBut(null, *) = -1
@@ -1710,9 +1710,9 @@ public static int indexOfAnyBut(String str, String searchChars) {
/**
* Checks if the CharSequence contains only certain characters.
*
- * A null
CharSequence will return false
.
- * A null
valid character array will return false
.
- * An empty CharSequence (length()=0) always returns true
.
+ * A {@code null} CharSequence will return {@code false}.
+ * A {@code null} valid character array will return {@code false}.
+ * An empty CharSequence (length()=0) always returns {@code true}.
*
*
* StringUtils.containsOnly(null, *) = false
@@ -1746,9 +1746,9 @@ public static boolean containsOnly(CharSequence cs, char[] valid) {
/**
* Checks if the CharSequence contains only certain characters.
*
- * A null
CharSequence will return false
.
- * A null
valid character String will return false
.
- * An empty String (length()=0) always returns true
.
+ * A {@code null} CharSequence will return {@code false}.
+ * A {@code null} valid character String will return {@code false}.
+ * An empty String (length()=0) always returns {@code true}.
*
*
* StringUtils.containsOnly(null, *) = false
@@ -1778,8 +1778,8 @@ public static boolean containsOnly(CharSequence cs, String validChars) {
/**
* Checks that the CharSequence does not contain certain characters.
*
- * A null
CharSequence will return true
.
- * A null
invalid character array will return true
.
+ *
A {@code null} CharSequence will return {@code true}.
+ * A {@code null} invalid character array will return {@code true}.
* An empty CharSequence (length()=0) always returns true.
*
*
@@ -1831,8 +1831,8 @@ public static boolean containsNone(CharSequence cs, char[] searchChars) {
/**
* Checks that the CharSequence does not contain certain characters.
*
- * A null
CharSequence will return true
.
- * A null
invalid character array will return true
.
+ *
A {@code null} CharSequence will return {@code true}.
+ * A {@code null} invalid character array will return {@code true}.
* An empty String ("") always returns true.
*
*
@@ -1863,10 +1863,10 @@ public static boolean containsNone(CharSequence cs, String invalidChars) {
/**
* Find the first index of any of a set of potential substrings.
*
- * A null
String will return -1
.
- * A null
or zero length search array will return -1
.
- * A null
search array entry will be ignored, but a search
- * array containing "" will return 0
if str
is not
+ *
A {@code null} String will return {@code -1}.
+ * A {@code null} or zero length search array will return {@code -1}.
+ * A {@code null} search array entry will be ignored, but a search
+ * array containing "" will return {@code 0} if {@code str} is not
* null. This method uses {@link String#indexOf(String)}.
*
*
@@ -1917,11 +1917,11 @@ public static int indexOfAny(String str, String[] searchStrs) {
/**
* Find the latest index of any of a set of potential substrings.
*
- * A null
String will return -1
.
- * A null
search array will return -1
.
- * A null
or zero length search array entry will be ignored,
- * but a search array containing "" will return the length of str
- * if str
is not null. This method uses {@link String#indexOf(String)}
+ * A {@code null} String will return {@code -1}.
+ * A {@code null} search array will return {@code -1}.
+ * A {@code null} or zero length search array entry will be ignored,
+ * but a search array containing "" will return the length of {@code str}
+ * if {@code str} is not null. This method uses {@link String#indexOf(String)}
*
*
* StringUtils.lastIndexOfAny(null, *) = -1
@@ -1964,10 +1964,10 @@ public static int lastIndexOfAny(String str, String[] searchStrs) {
/**
* Gets a substring from the specified String avoiding exceptions.
*
- * A negative start position can be used to start n
+ *
A negative start position can be used to start {@code n}
* characters from the end of the String.
*
- * A null
String will return null
.
+ *
A {@code null} String will return {@code null}.
* An empty ("") String will return "".
*
*
@@ -1983,7 +1983,7 @@ public static int lastIndexOfAny(String str, String[] searchStrs) {
* @param str the String to get the substring from, may be null
* @param start the position to start from, negative means
* count back from the end of the String by this many characters
- * @return substring from start position, null
if null String input
+ * @return substring from start position, {@code null} if null String input
*/
public static String substring(String str, int start) {
if (str == null) {
@@ -2008,16 +2008,16 @@ public static String substring(String str, int start) {
/**
* Gets a substring from the specified String avoiding exceptions.
*
- * A negative start position can be used to start/end n
+ *
A negative start position can be used to start/end {@code n}
* characters from the end of the String.
*
- * The returned substring starts with the character in the start
- * position and ends before the end
position. All position counting is
+ *
The returned substring starts with the character in the {@code start}
+ * position and ends before the {@code end} position. All position counting is
* zero-based -- i.e., to start at the beginning of the string use
- * start = 0
. Negative start and end positions can be used to
+ * {@code start = 0}. Negative start and end positions can be used to
* specify offsets relative to the end of the String.
*
- * If start
is not strictly to the left of end
, ""
+ *
If {@code start} is not strictly to the left of {@code end}, ""
* is returned.
*
*
@@ -2038,7 +2038,7 @@ public static String substring(String str, int start) {
* @param end the position to end at (exclusive), negative means
* count back from the end of the String by this many characters
* @return substring from start position to end positon,
- * null
if null String input
+ * {@code null} if null String input
*/
public static String substring(String str, int start, int end) {
if (str == null) {
@@ -2076,10 +2076,10 @@ public static String substring(String str, int start, int end) {
// Left/Right/Mid
//-----------------------------------------------------------------------
/**
- * Gets the leftmost len
characters of a String.
+ * Gets the leftmost {@code len} characters of a String.
*
- * If len
characters are not available, or the
- * String is null
, the String will be returned without
+ *
If {@code len} characters are not available, or the
+ * String is {@code null}, the String will be returned without
* an exception. An empty String is returned if len is negative.
*
*
@@ -2093,7 +2093,7 @@ public static String substring(String str, int start, int end) {
*
* @param str the String to get the leftmost characters from, may be null
* @param len the length of the required String
- * @return the leftmost characters, null
if null String input
+ * @return the leftmost characters, {@code null} if null String input
*/
public static String left(String str, int len) {
if (str == null) {
@@ -2109,10 +2109,10 @@ public static String left(String str, int len) {
}
/**
- * Gets the rightmost len
characters of a String.
+ * Gets the rightmost {@code len} characters of a String.
*
- * If len
characters are not available, or the String
- * is null
, the String will be returned without an
+ *
If {@code len} characters are not available, or the String
+ * is {@code null}, the String will be returned without an
* an exception. An empty String is returned if len is negative.
*
*
@@ -2126,7 +2126,7 @@ public static String left(String str, int len) {
*
* @param str the String to get the rightmost characters from, may be null
* @param len the length of the required String
- * @return the rightmost characters, null
if null String input
+ * @return the rightmost characters, {@code null} if null String input
*/
public static String right(String str, int len) {
if (str == null) {
@@ -2142,13 +2142,13 @@ public static String right(String str, int len) {
}
/**
- * Gets len
characters from the middle of a String.
+ * Gets {@code len} characters from the middle of a String.
*
- * If len
characters are not available, the remainder
+ *
If {@code len} characters are not available, the remainder
* of the String will be returned without an exception. If the
- * String is null
, null
will be returned.
+ * String is {@code null}, {@code null} will be returned.
* An empty String is returned if len is negative or exceeds the
- * length of str
.
+ * length of {@code str}.
*
*
* StringUtils.mid(null, *, *) = null
@@ -2164,7 +2164,7 @@ public static String right(String str, int len) {
* @param str the String to get the characters from, may be null
* @param pos the position to start from, negative treated as zero
* @param len the length of the required String
- * @return the middle characters, null
if null String input
+ * @return the middle characters, {@code null} if null String input
*/
public static String mid(String str, int pos, int len) {
if (str == null) {
@@ -2188,9 +2188,9 @@ public static String mid(String str, int pos, int len) {
* Gets the substring before the first occurrence of a separator.
* The separator is not returned.
*
- * A null
string input will return null
.
+ *
A {@code null} string input will return {@code null}.
* An empty ("") string input will return the empty string.
- * A null
separator will return the input string.
+ * A {@code null} separator will return the input string.
*
* If nothing is found, the string input is returned.
*
@@ -2208,7 +2208,7 @@ public static String mid(String str, int pos, int len) {
* @param str the String to get a substring from, may be null
* @param separator the String to search for, may be null
* @return the substring before the first occurrence of the separator,
- * null
if null String input
+ * {@code null} if null String input
* @since 2.0
*/
public static String substringBefore(String str, String separator) {
@@ -2229,10 +2229,10 @@ public static String substringBefore(String str, String separator) {
* Gets the substring after the first occurrence of a separator.
* The separator is not returned.
*
- * A null
string input will return null
.
+ *
A {@code null} string input will return {@code null}.
* An empty ("") string input will return the empty string.
- * A null
separator will return the empty string if the
- * input string is not null
.
+ * A {@code null} separator will return the empty string if the
+ * input string is not {@code null}.
*
* If nothing is found, the empty string is returned.
*
@@ -2250,7 +2250,7 @@ public static String substringBefore(String str, String separator) {
* @param str the String to get a substring from, may be null
* @param separator the String to search for, may be null
* @return the substring after the first occurrence of the separator,
- * null
if null String input
+ * {@code null} if null String input
* @since 2.0
*/
public static String substringAfter(String str, String separator) {
@@ -2271,9 +2271,9 @@ public static String substringAfter(String str, String separator) {
* Gets the substring before the last occurrence of a separator.
* The separator is not returned.
*
- * A null
string input will return null
.
+ *
A {@code null} string input will return {@code null}.
* An empty ("") string input will return the empty string.
- * An empty or null
separator will return the input string.
+ * An empty or {@code null} separator will return the input string.
*
* If nothing is found, the string input is returned.
*
@@ -2291,7 +2291,7 @@ public static String substringAfter(String str, String separator) {
* @param str the String to get a substring from, may be null
* @param separator the String to search for, may be null
* @return the substring before the last occurrence of the separator,
- * null
if null String input
+ * {@code null} if null String input
* @since 2.0
*/
public static String substringBeforeLast(String str, String separator) {
@@ -2309,10 +2309,10 @@ public static String substringBeforeLast(String str, String separator) {
* Gets the substring after the last occurrence of a separator.
* The separator is not returned.
*
- * A null
string input will return null
.
+ *
A {@code null} string input will return {@code null}.
* An empty ("") string input will return the empty string.
- * An empty or null
separator will return the empty string if
- * the input string is not null
.
+ * An empty or {@code null} separator will return the empty string if
+ * the input string is not {@code null}.
*
* If nothing is found, the empty string is returned.
*
@@ -2331,7 +2331,7 @@ public static String substringBeforeLast(String str, String separator) {
* @param str the String to get a substring from, may be null
* @param separator the String to search for, may be null
* @return the substring after the last occurrence of the separator,
- * null
if null String input
+ * {@code null} if null String input
* @since 2.0
*/
public static String substringAfterLast(String str, String separator) {
@@ -2354,8 +2354,8 @@ public static String substringAfterLast(String str, String separator) {
* Gets the String that is nested in between two instances of the
* same String.
*
- * A null
input String returns null
.
- * A null
tag returns null
.
+ * A {@code null} input String returns {@code null}.
+ * A {@code null} tag returns {@code null}.
*
*
* StringUtils.substringBetween(null, *) = null
@@ -2368,7 +2368,7 @@ public static String substringAfterLast(String str, String separator) {
*
* @param str the String containing the substring, may be null
* @param tag the String before and after the substring, may be null
- * @return the substring, null
if no match
+ * @return the substring, {@code null} if no match
* @since 2.0
*/
public static String substringBetween(String str, String tag) {
@@ -2379,8 +2379,8 @@ public static String substringBetween(String str, String tag) {
* Gets the String that is nested in between two Strings.
* Only the first match is returned.
*
- * A null
input String returns null
.
- * A null
open/close returns null
(no match).
+ *
A {@code null} input String returns {@code null}.
+ * A {@code null} open/close returns {@code null} (no match).
* An empty ("") open and close returns an empty string.
*
*
@@ -2399,7 +2399,7 @@ public static String substringBetween(String str, String tag) {
* @param str the String containing the substring, may be null
* @param open the String before the substring, may be null
* @param close the String after the substring, may be null
- * @return the substring, null
if no match
+ * @return the substring, {@code null} if no match
* @since 2.0
*/
public static String substringBetween(String str, String open, String close) {
@@ -2420,9 +2420,9 @@ public static String substringBetween(String str, String open, String close) {
* Searches a String for substrings delimited by a start and end tag,
* returning all matching substrings in an array.
*
- * A null
input String returns null
.
- * A null
open/close returns null
(no match).
- * An empty ("") open/close returns null
(no match).
+ * A {@code null} input String returns {@code null}.
+ * A {@code null} open/close returns {@code null} (no match).
+ * An empty ("") open/close returns {@code null} (no match).
*
*
* StringUtils.substringsBetween("[a][b][c]", "[", "]") = ["a","b","c"]
@@ -2435,7 +2435,7 @@ public static String substringBetween(String str, String open, String close) {
* @param str the String containing the substrings, null returns null, empty returns empty
* @param open the String identifying the start of the substring, empty returns null
* @param close the String identifying the end of the substring, empty returns null
- * @return a String Array of substrings, or null
if no match
+ * @return a String Array of substrings, or {@code null} if no match
* @since 2.3
*/
public static String[] substringsBetween(String str, String open, String close) {
@@ -2483,7 +2483,7 @@ public static String[] substringsBetween(String str, String open, String close)
* Adjacent separators are treated as one separator.
* For more control over the split use the StrTokenizer class.
*
- * A null
input String returns null
.
+ * A {@code null} input String returns {@code null}.
*
*
* StringUtils.split(null) = null
@@ -2494,7 +2494,7 @@ public static String[] substringsBetween(String str, String open, String close)
*
*
* @param str the String to parse, may be null
- * @return an array of parsed Strings, null
if null String input
+ * @return an array of parsed Strings, {@code null} if null String input
*/
public static String[] split(String str) {
return split(str, null, -1);
@@ -2508,7 +2508,7 @@ public static String[] split(String str) {
* Adjacent separators are treated as one separator.
* For more control over the split use the StrTokenizer class.
*
- * A null
input String returns null
.
+ * A {@code null} input String returns {@code null}.
*
*
* StringUtils.split(null, *) = null
@@ -2521,7 +2521,7 @@ public static String[] split(String str) {
*
* @param str the String to parse, may be null
* @param separatorChar the character used as the delimiter
- * @return an array of parsed Strings, null
if null String input
+ * @return an array of parsed Strings, {@code null} if null String input
* @since 2.0
*/
public static String[] split(String str, char separatorChar) {
@@ -2536,8 +2536,8 @@ public static String[] split(String str, char separatorChar) {
* Adjacent separators are treated as one separator.
* For more control over the split use the StrTokenizer class.
*
- * A null
input String returns null
.
- * A null
separatorChars splits on whitespace.
+ * A {@code null} input String returns {@code null}.
+ * A {@code null} separatorChars splits on whitespace.
*
*
* StringUtils.split(null, *) = null
@@ -2550,8 +2550,8 @@ public static String[] split(String str, char separatorChar) {
*
* @param str the String to parse, may be null
* @param separatorChars the characters used as the delimiters,
- * null
splits on whitespace
- * @return an array of parsed Strings, null
if null String input
+ * {@code null} splits on whitespace
+ * @return an array of parsed Strings, {@code null} if null String input
*/
public static String[] split(String str, String separatorChars) {
return splitWorker(str, separatorChars, -1, false);
@@ -2564,11 +2564,11 @@ public static String[] split(String str, String separatorChars) {
* The separator is not included in the returned String array.
* Adjacent separators are treated as one separator.
*
- * A null
input String returns null
.
- * A null
separatorChars splits on whitespace.
+ * A {@code null} input String returns {@code null}.
+ * A {@code null} separatorChars splits on whitespace.
*
- * If more than max
delimited substrings are found, the last
- * returned string includes all characters after the first max - 1
+ *
If more than {@code max} delimited substrings are found, the last
+ * returned string includes all characters after the first {@code max - 1}
* returned strings (including separator characters).
*
*
@@ -2582,10 +2582,10 @@ public static String[] split(String str, String separatorChars) {
*
* @param str the String to parse, may be null
* @param separatorChars the characters used as the delimiters,
- * null
splits on whitespace
+ * {@code null} splits on whitespace
* @param max the maximum number of elements to include in the
* array. A zero or negative value implies no limit
- * @return an array of parsed Strings, null
if null String input
+ * @return an array of parsed Strings, {@code null} if null String input
*/
public static String[] split(String str, String separatorChars, int max) {
return splitWorker(str, separatorChars, max, false);
@@ -2597,8 +2597,8 @@ public static String[] split(String str, String separatorChars, int max) {
* The separator(s) will not be included in the returned String array.
* Adjacent separators are treated as one separator.
*
- * A null
input String returns null
.
- * A null
separator splits on whitespace.
+ * A {@code null} input String returns {@code null}.
+ * A {@code null} separator splits on whitespace.
*
*
* StringUtils.splitByWholeSeparator(null, *) = null
@@ -2611,8 +2611,8 @@ public static String[] split(String str, String separatorChars, int max) {
*
* @param str the String to parse, may be null
* @param separator String containing the String to be used as a delimiter,
- * null
splits on whitespace
- * @return an array of parsed Strings, null
if null String was input
+ * {@code null} splits on whitespace
+ * @return an array of parsed Strings, {@code null} if null String was input
*/
public static String[] splitByWholeSeparator(String str, String separator) {
return splitByWholeSeparatorWorker( str, separator, -1, false ) ;
@@ -2620,13 +2620,13 @@ public static String[] splitByWholeSeparator(String str, String separator) {
/**
* Splits the provided text into an array, separator string specified.
- * Returns a maximum of max
substrings.
+ * Returns a maximum of {@code max} substrings.
*
* The separator(s) will not be included in the returned String array.
* Adjacent separators are treated as one separator.
*
- * A null
input String returns null
.
- * A null
separator splits on whitespace.
+ * A {@code null} input String returns {@code null}.
+ * A {@code null} separator splits on whitespace.
*
*
* StringUtils.splitByWholeSeparator(null, *, *) = null
@@ -2640,10 +2640,10 @@ public static String[] splitByWholeSeparator(String str, String separator) {
*
* @param str the String to parse, may be null
* @param separator String containing the String to be used as a delimiter,
- * null
splits on whitespace
+ * {@code null} splits on whitespace
* @param max the maximum number of elements to include in the returned
* array. A zero or negative value implies no limit.
- * @return an array of parsed Strings, null
if null String was input
+ * @return an array of parsed Strings, {@code null} if null String was input
*/
public static String[] splitByWholeSeparator( String str, String separator, int max ) {
return splitByWholeSeparatorWorker(str, separator, max, false);
@@ -2656,8 +2656,8 @@ public static String[] splitByWholeSeparator( String str, String separator, int
* Adjacent separators are treated as separators for empty tokens.
* For more control over the split use the StrTokenizer class.
*
- * A null
input String returns null
.
- * A null
separator splits on whitespace.
+ * A {@code null} input String returns {@code null}.
+ * A {@code null} separator splits on whitespace.
*
*
* StringUtils.splitByWholeSeparatorPreserveAllTokens(null, *) = null
@@ -2670,8 +2670,8 @@ public static String[] splitByWholeSeparator( String str, String separator, int
*
* @param str the String to parse, may be null
* @param separator String containing the String to be used as a delimiter,
- * null
splits on whitespace
- * @return an array of parsed Strings, null
if null String was input
+ * {@code null} splits on whitespace
+ * @return an array of parsed Strings, {@code null} if null String was input
* @since 2.4
*/
public static String[] splitByWholeSeparatorPreserveAllTokens(String str, String separator) {
@@ -2680,14 +2680,14 @@ public static String[] splitByWholeSeparatorPreserveAllTokens(String str, String
/**
* Splits the provided text into an array, separator string specified.
- * Returns a maximum of max
substrings.
+ * Returns a maximum of {@code max} substrings.
*
* The separator is not included in the returned String array.
* Adjacent separators are treated as separators for empty tokens.
* For more control over the split use the StrTokenizer class.
*
- * A null
input String returns null
.
- * A null
separator splits on whitespace.
+ * A {@code null} input String returns {@code null}.
+ * A {@code null} separator splits on whitespace.
*
*
* StringUtils.splitByWholeSeparatorPreserveAllTokens(null, *, *) = null
@@ -2701,10 +2701,10 @@ public static String[] splitByWholeSeparatorPreserveAllTokens(String str, String
*
* @param str the String to parse, may be null
* @param separator String containing the String to be used as a delimiter,
- * null
splits on whitespace
+ * {@code null} splits on whitespace
* @param max the maximum number of elements to include in the returned
* array. A zero or negative value implies no limit.
- * @return an array of parsed Strings, null
if null String was input
+ * @return an array of parsed Strings, {@code null} if null String was input
* @since 2.4
*/
public static String[] splitByWholeSeparatorPreserveAllTokens(String str, String separator, int max) {
@@ -2712,17 +2712,17 @@ public static String[] splitByWholeSeparatorPreserveAllTokens(String str, String
}
/**
- * Performs the logic for the splitByWholeSeparatorPreserveAllTokens
methods.
+ * Performs the logic for the {@code splitByWholeSeparatorPreserveAllTokens} methods.
*
- * @param str the String to parse, may be null
+ * @param str the String to parse, may be {@code null}
* @param separator String containing the String to be used as a delimiter,
- * null
splits on whitespace
+ * {@code null} splits on whitespace
* @param max the maximum number of elements to include in the returned
* array. A zero or negative value implies no limit.
- * @param preserveAllTokens if true
, adjacent separators are
- * treated as empty token separators; if false
, adjacent
+ * @param preserveAllTokens if {@code true}, adjacent separators are
+ * treated as empty token separators; if {@code false}, adjacent
* separators are treated as one separator.
- * @return an array of parsed Strings, null
if null String input
+ * @return an array of parsed Strings, {@code null} if null String input
* @since 2.4
*/
private static String[] splitByWholeSeparatorWorker(
@@ -2802,7 +2802,7 @@ private static String[] splitByWholeSeparatorWorker(
* Adjacent separators are treated as separators for empty tokens.
* For more control over the split use the StrTokenizer class.
*
- * A null
input String returns null
.
+ * A {@code null} input String returns {@code null}.
*
*
* StringUtils.splitPreserveAllTokens(null) = null
@@ -2812,8 +2812,8 @@ private static String[] splitByWholeSeparatorWorker(
* StringUtils.splitPreserveAllTokens(" abc ") = ["", "abc", ""]
*
*
- * @param str the String to parse, may be null
- * @return an array of parsed Strings, null
if null String input
+ * @param str the String to parse, may be {@code null}
+ * @return an array of parsed Strings, {@code null} if null String input
* @since 2.1
*/
public static String[] splitPreserveAllTokens(String str) {
@@ -2829,7 +2829,7 @@ public static String[] splitPreserveAllTokens(String str) {
* Adjacent separators are treated as separators for empty tokens.
* For more control over the split use the StrTokenizer class.
*
- * A null
input String returns null
.
+ * A {@code null} input String returns {@code null}.
*
*
* StringUtils.splitPreserveAllTokens(null, *) = null
@@ -2846,10 +2846,10 @@ public static String[] splitPreserveAllTokens(String str) {
* StringUtils.splitPreserveAllTokens(" a b c ", ' ') = ["", a", "b", "c", ""]
*
*
- * @param str the String to parse, may be null
+ * @param str the String to parse, may be {@code null}
* @param separatorChar the character used as the delimiter,
- * null
splits on whitespace
- * @return an array of parsed Strings, null
if null String input
+ * {@code null} splits on whitespace
+ * @return an array of parsed Strings, {@code null} if null String input
* @since 2.1
*/
public static String[] splitPreserveAllTokens(String str, char separatorChar) {
@@ -2857,16 +2857,16 @@ public static String[] splitPreserveAllTokens(String str, char separatorChar) {
}
/**
- * Performs the logic for the split
and
- * splitPreserveAllTokens
methods that do not return a
+ * Performs the logic for the {@code split} and
+ * {@code splitPreserveAllTokens} methods that do not return a
* maximum array length.
*
- * @param str the String to parse, may be null
+ * @param str the String to parse, may be {@code null}
* @param separatorChar the separate character
- * @param preserveAllTokens if true
, adjacent separators are
- * treated as empty token separators; if false
, adjacent
+ * @param preserveAllTokens if {@code true}, adjacent separators are
+ * treated as empty token separators; if {@code false}, adjacent
* separators are treated as one separator.
- * @return an array of parsed Strings, null
if null String input
+ * @return an array of parsed Strings, {@code null} if null String input
*/
private static String[] splitWorker(String str, char separatorChar, boolean preserveAllTokens) {
// Performance tuned for 2.0 (JDK1.4)
@@ -2911,8 +2911,8 @@ private static String[] splitWorker(String str, char separatorChar, boolean pres
* Adjacent separators are treated as separators for empty tokens.
* For more control over the split use the StrTokenizer class.
*
- * A null
input String returns null
.
- * A null
separatorChars splits on whitespace.
+ * A {@code null} input String returns {@code null}.
+ * A {@code null} separatorChars splits on whitespace.
*
*
* StringUtils.splitPreserveAllTokens(null, *) = null
@@ -2929,10 +2929,10 @@ private static String[] splitWorker(String str, char separatorChar, boolean pres
* StringUtils.splitPreserveAllTokens(":cd:ef:", ":") = ["", cd", "ef", ""]
*
*
- * @param str the String to parse, may be null
+ * @param str the String to parse, may be {@code null}
* @param separatorChars the characters used as the delimiters,
- * null
splits on whitespace
- * @return an array of parsed Strings, null
if null String input
+ * {@code null} splits on whitespace
+ * @return an array of parsed Strings, {@code null} if null String input
* @since 2.1
*/
public static String[] splitPreserveAllTokens(String str, String separatorChars) {
@@ -2948,11 +2948,11 @@ public static String[] splitPreserveAllTokens(String str, String separatorChars)
* Adjacent separators are treated as separators for empty tokens.
* Adjacent separators are treated as one separator.
*
- * A null
input String returns null
.
- * A null
separatorChars splits on whitespace.
+ * A {@code null} input String returns {@code null}.
+ * A {@code null} separatorChars splits on whitespace.
*
- * If more than max
delimited substrings are found, the last
- * returned string includes all characters after the first max - 1
+ *
If more than {@code max} delimited substrings are found, the last
+ * returned string includes all characters after the first {@code max - 1}
* returned strings (including separator characters).
*
*
@@ -2967,12 +2967,12 @@ public static String[] splitPreserveAllTokens(String str, String separatorChars)
* StringUtils.splitPreserveAllTokens("ab de fg", null, 4) = ["ab", "", "", "de fg"]
*
*
- * @param str the String to parse, may be null
+ * @param str the String to parse, may be {@code null}
* @param separatorChars the characters used as the delimiters,
- * null
splits on whitespace
+ * {@code null} splits on whitespace
* @param max the maximum number of elements to include in the
* array. A zero or negative value implies no limit
- * @return an array of parsed Strings, null
if null String input
+ * @return an array of parsed Strings, {@code null} if null String input
* @since 2.1
*/
public static String[] splitPreserveAllTokens(String str, String separatorChars, int max) {
@@ -2980,18 +2980,18 @@ public static String[] splitPreserveAllTokens(String str, String separatorChars,
}
/**
- * Performs the logic for the split
and
- * splitPreserveAllTokens
methods that return a maximum array
+ * Performs the logic for the {@code split} and
+ * {@code splitPreserveAllTokens} methods that return a maximum array
* length.
*
- * @param str the String to parse, may be null
+ * @param str the String to parse, may be {@code null}
* @param separatorChars the separate character
* @param max the maximum number of elements to include in the
* array. A zero or negative value implies no limit.
- * @param preserveAllTokens if true
, adjacent separators are
- * treated as empty token separators; if false
, adjacent
+ * @param preserveAllTokens if {@code true}, adjacent separators are
+ * treated as empty token separators; if {@code false}, adjacent
* separators are treated as one separator.
- * @return an array of parsed Strings, null
if null String input
+ * @return an array of parsed Strings, {@code null} if null String input
*/
private static String[] splitWorker(String str, String separatorChars, int max, boolean preserveAllTokens) {
// Performance tuned for 2.0 (JDK1.4)
@@ -3080,7 +3080,7 @@ private static String[] splitWorker(String str, String separatorChars, int max,
/**
* Splits a String by Character type as returned by
- * java.lang.Character.getType(char)
. Groups of contiguous
+ * {@code java.lang.Character.getType(char)}. Groups of contiguous
* characters of the same type are returned as complete tokens.
*
* StringUtils.splitByCharacterType(null) = null
@@ -3093,8 +3093,8 @@ private static String[] splitWorker(String str, String separatorChars, int max,
* StringUtils.splitByCharacterType("foo200Bar") = ["foo", "200", "B", "ar"]
* StringUtils.splitByCharacterType("ASFRules") = ["ASFR", "ules"]
*
- * @param str the String to split, may be null
- * @return an array of parsed Strings, null
if null String input
+ * @param str the String to split, may be {@code null}
+ * @return an array of parsed Strings, {@code null} if null String input
* @since 2.4
*/
public static String[] splitByCharacterType(String str) {
@@ -3103,13 +3103,13 @@ public static String[] splitByCharacterType(String str) {
/**
* Splits a String by Character type as returned by
- * java.lang.Character.getType(char)
. Groups of contiguous
+ * {@code java.lang.Character.getType(char)}. Groups of contiguous
* characters of the same type are returned as complete tokens, with the
* following exception: the character of type
- * Character.UPPERCASE_LETTER
, if any, immediately
- * preceding a token of type Character.LOWERCASE_LETTER
+ * {@code Character.UPPERCASE_LETTER}, if any, immediately
+ * preceding a token of type {@code Character.LOWERCASE_LETTER}
* will belong to the following token rather than to the preceding, if any,
- * Character.UPPERCASE_LETTER
token.
+ * {@code Character.UPPERCASE_LETTER} token.
*
* StringUtils.splitByCharacterTypeCamelCase(null) = null
* StringUtils.splitByCharacterTypeCamelCase("") = []
@@ -3121,8 +3121,8 @@ public static String[] splitByCharacterType(String str) {
* StringUtils.splitByCharacterTypeCamelCase("foo200Bar") = ["foo", "200", "Bar"]
* StringUtils.splitByCharacterTypeCamelCase("ASFRules") = ["ASF", "Rules"]
*
- * @param str the String to split, may be null
- * @return an array of parsed Strings, null
if null String input
+ * @param str the String to split, may be {@code null}
+ * @return an array of parsed Strings, {@code null} if null String input
* @since 2.4
*/
public static String[] splitByCharacterTypeCamelCase(String str) {
@@ -3131,16 +3131,16 @@ public static String[] splitByCharacterTypeCamelCase(String str) {
/**
* Splits a String by Character type as returned by
- * java.lang.Character.getType(char)
. Groups of contiguous
+ * {@code java.lang.Character.getType(char)}. Groups of contiguous
* characters of the same type are returned as complete tokens, with the
- * following exception: if camelCase
is true
,
- * the character of type Character.UPPERCASE_LETTER
, if any,
- * immediately preceding a token of type Character.LOWERCASE_LETTER
+ * following exception: if {@code camelCase} is {@code true},
+ * the character of type {@code Character.UPPERCASE_LETTER}, if any,
+ * immediately preceding a token of type {@code Character.LOWERCASE_LETTER}
* will belong to the following token rather than to the preceding, if any,
- * Character.UPPERCASE_LETTER
token.
- * @param str the String to split, may be null
+ * {@code Character.UPPERCASE_LETTER} token.
+ * @param str the String to split, may be {@code null}
* @param camelCase whether to use so-called "camel-case" for letter types
- * @return an array of parsed Strings, null
if null String input
+ * @return an array of parsed Strings, {@code null} if null String input
* @since 2.4
*/
private static String[] splitByCharacterType(String str, boolean camelCase) {
@@ -3236,7 +3236,7 @@ public static String concatWith(String separator, Object... elements) {
*
*
* @param array the array of values to join together, may be null
- * @return the joined String, null
if null array input
+ * @return the joined String, {@code null} if null array input
* @since 2.0
*/
public static String join(Object[] array) {
@@ -3262,7 +3262,7 @@ public static String join(Object[] array) {
*
* @param array the array of values to join together, may be null
* @param separator the separator character to use
- * @return the joined String, null
if null array input
+ * @return the joined String, {@code null} if null array input
* @since 2.0
*/
public static String join(Object[] array, char separator) {
@@ -3296,7 +3296,7 @@ public static String join(Object[] array, char separator) {
* an error to pass in an end index past the end of the array
* @param endIndex the index to stop joining from (exclusive). It is
* an error to pass in an end index past the end of the array
- * @return the joined String, null
if null array input
+ * @return the joined String, {@code null} if null array input
* @since 2.0
*/
public static String join(Object[] array, char separator, int startIndex, int endIndex) {
@@ -3328,7 +3328,7 @@ public static String join(Object[] array, char separator, int startIndex, int en
* containing the provided list of elements.
*
* No delimiter is added before or after the list.
- * A null
separator is the same as an empty String ("").
+ * A {@code null} separator is the same as an empty String ("").
* Null objects or empty strings within the array are represented by
* empty strings.
*
@@ -3344,7 +3344,7 @@ public static String join(Object[] array, char separator, int startIndex, int en
*
* @param array the array of values to join together, may be null
* @param separator the separator character to use, null treated as ""
- * @return the joined String, null
if null array input
+ * @return the joined String, {@code null} if null array input
*/
public static String join(Object[] array, String separator) {
if (array == null) {
@@ -3358,7 +3358,7 @@ public static String join(Object[] array, String separator) {
* containing the provided list of elements.
*
* No delimiter is added before or after the list.
- * A null
separator is the same as an empty String ("").
+ * A {@code null} separator is the same as an empty String ("").
* Null objects or empty strings within the array are represented by
* empty strings.
*
@@ -3378,7 +3378,7 @@ public static String join(Object[] array, String separator) {
* an error to pass in an end index past the end of the array
* @param endIndex the index to stop joining from (exclusive). It is
* an error to pass in an end index past the end of the array
- * @return the joined String, null
if null array input
+ * @return the joined String, {@code null} if null array input
*/
public static String join(Object[] array, String separator, int startIndex, int endIndex) {
if (array == null) {
@@ -3412,7 +3412,7 @@ public static String join(Object[] array, String separator, int startIndex, int
}
/**
- * Joins the elements of the provided Iterator
into
+ *
Joins the elements of the provided {@code Iterator} into
* a single String containing the provided elements.
*
* No delimiter is added before or after the list. Null objects or empty
@@ -3420,9 +3420,9 @@ public static String join(Object[] array, String separator, int startIndex, int
*
*
See the examples here: {@link #join(Object[],char)}.
*
- * @param iterator the Iterator
of values to join together, may be null
+ * @param iterator the {@code Iterator} of values to join together, may be null
* @param separator the separator character to use
- * @return the joined String, null
if null iterator input
+ * @return the joined String, {@code null} if null iterator input
* @since 2.0
*/
public static String join(Iterator> iterator, char separator) {
@@ -3457,17 +3457,17 @@ public static String join(Iterator> iterator, char separator) {
}
/**
- * Joins the elements of the provided Iterator
into
+ *
Joins the elements of the provided {@code Iterator} into
* a single String containing the provided elements.
*
* No delimiter is added before or after the list.
- * A null
separator is the same as an empty String ("").
+ * A {@code null} separator is the same as an empty String ("").
*
* See the examples here: {@link #join(Object[],String)}.
*
- * @param iterator the Iterator
of values to join together, may be null
+ * @param iterator the {@code Iterator} of values to join together, may be null
* @param separator the separator character to use, null treated as ""
- * @return the joined String, null
if null iterator input
+ * @return the joined String, {@code null} if null iterator input
*/
public static String join(Iterator> iterator, String separator) {
@@ -3502,7 +3502,7 @@ public static String join(Iterator> iterator, String separator) {
}
/**
- * Joins the elements of the provided Iterable
into
+ *
Joins the elements of the provided {@code Iterable} into
* a single String containing the provided elements.
*
* No delimiter is added before or after the list. Null objects or empty
@@ -3510,9 +3510,9 @@ public static String join(Iterator> iterator, String separator) {
*
*
See the examples here: {@link #join(Object[],char)}.
*
- * @param iterable the Iterable
providing the values to join together, may be null
+ * @param iterable the {@code Iterable} providing the values to join together, may be null
* @param separator the separator character to use
- * @return the joined String, null
if null iterator input
+ * @return the joined String, {@code null} if null iterator input
* @since 2.3
*/
public static String join(Iterable> iterable, char separator) {
@@ -3523,17 +3523,17 @@ public static String join(Iterable> iterable, char separator) {
}
/**
- * Joins the elements of the provided Iterable
into
+ *
Joins the elements of the provided {@code Iterable} into
* a single String containing the provided elements.
*
* No delimiter is added before or after the list.
- * A null
separator is the same as an empty String ("").
+ * A {@code null} separator is the same as an empty String ("").
*
* See the examples here: {@link #join(Object[],String)}.
*
- * @param iterable the Iterable
providing the values to join together, may be null
+ * @param iterable the {@code Iterable} providing the values to join together, may be null
* @param separator the separator character to use, null treated as ""
- * @return the joined String, null
if null iterator input
+ * @return the joined String, {@code null} if null iterator input
* @since 2.3
*/
public static String join(Iterable> iterable, String separator) {
@@ -3557,7 +3557,7 @@ public static String join(Iterable> iterable, String separator) {
*
*
* @param str the String to delete whitespace from, may be null
- * @return the String without whitespaces, null
if null String input
+ * @return the String without whitespaces, {@code null} if null String input
*/
public static String deleteWhitespace(String str) {
if (isEmpty(str)) {
@@ -3583,9 +3583,9 @@ public static String deleteWhitespace(String str) {
* Removes a substring only if it is at the begining of a source string,
* otherwise returns the source string.
*
- * A null
source string will return null
.
+ *
A {@code null} source string will return {@code null}.
* An empty ("") source string will return the empty string.
- * A null
search string will return the source string.
+ * A {@code null} search string will return the source string.
*
*
* StringUtils.removeStart(null, *) = null
@@ -3600,7 +3600,7 @@ public static String deleteWhitespace(String str) {
* @param str the source String to search, may be null
* @param remove the String to search for and remove, may be null
* @return the substring with the string removed if found,
- * null
if null String input
+ * {@code null} if null String input
* @since 2.1
*/
public static String removeStart(String str, String remove) {
@@ -3617,9 +3617,9 @@ public static String removeStart(String str, String remove) {
* Case insensitive removal of a substring if it is at the begining of a source string,
* otherwise returns the source string.
*
- * A null
source string will return null
.
+ *
A {@code null} source string will return {@code null}.
* An empty ("") source string will return the empty string.
- * A null
search string will return the source string.
+ * A {@code null} search string will return the source string.
*
*
* StringUtils.removeStartIgnoreCase(null, *) = null
@@ -3635,7 +3635,7 @@ public static String removeStart(String str, String remove) {
* @param str the source String to search, may be null
* @param remove the String to search for (case insensitive) and remove, may be null
* @return the substring with the string removed if found,
- * null
if null String input
+ * {@code null} if null String input
* @since 2.4
*/
public static String removeStartIgnoreCase(String str, String remove) {
@@ -3652,9 +3652,9 @@ public static String removeStartIgnoreCase(String str, String remove) {
* Removes a substring only if it is at the end of a source string,
* otherwise returns the source string.
*
- * A null
source string will return null
.
+ *
A {@code null} source string will return {@code null}.
* An empty ("") source string will return the empty string.
- * A null
search string will return the source string.
+ * A {@code null} search string will return the source string.
*
*
* StringUtils.removeEnd(null, *) = null
@@ -3669,7 +3669,7 @@ public static String removeStartIgnoreCase(String str, String remove) {
* @param str the source String to search, may be null
* @param remove the String to search for and remove, may be null
* @return the substring with the string removed if found,
- * null
if null String input
+ * {@code null} if null String input
* @since 2.1
*/
public static String removeEnd(String str, String remove) {
@@ -3686,9 +3686,9 @@ public static String removeEnd(String str, String remove) {
* Case insensitive removal of a substring if it is at the end of a source string,
* otherwise returns the source string.
*
- * A null
source string will return null
.
+ *
A {@code null} source string will return {@code null}.
* An empty ("") source string will return the empty string.
- * A null
search string will return the source string.
+ * A {@code null} search string will return the source string.
*
*
* StringUtils.removeEndIgnoreCase(null, *) = null
@@ -3705,7 +3705,7 @@ public static String removeEnd(String str, String remove) {
* @param str the source String to search, may be null
* @param remove the String to search for (case insensitive) and remove, may be null
* @return the substring with the string removed if found,
- * null
if null String input
+ * {@code null} if null String input
* @since 2.4
*/
public static String removeEndIgnoreCase(String str, String remove) {
@@ -3721,9 +3721,9 @@ public static String removeEndIgnoreCase(String str, String remove) {
/**
* Removes all occurrences of a substring from within the source string.
*
- * A null
source string will return null
.
+ *
A {@code null} source string will return {@code null}.
* An empty ("") source string will return the empty string.
- * A null
remove string will return the source string.
+ * A {@code null} remove string will return the source string.
* An empty ("") remove string will return the source string.
*
*
@@ -3738,7 +3738,7 @@ public static String removeEndIgnoreCase(String str, String remove) {
* @param str the source String to search, may be null
* @param remove the String to search for and remove, may be null
* @return the substring with the string removed if found,
- * null
if null String input
+ * {@code null} if null String input
* @since 2.1
*/
public static String remove(String str, String remove) {
@@ -3751,7 +3751,7 @@ public static String remove(String str, String remove) {
/**
* Removes all occurrences of a character from within the source string.
*
- * A null
source string will return null
.
+ *
A {@code null} source string will return {@code null}.
* An empty ("") source string will return the empty string.
*
*
@@ -3764,7 +3764,7 @@ public static String remove(String str, String remove) {
* @param str the source String to search, may be null
* @param remove the char to search for and remove, may be null
* @return the substring with the char removed if found,
- * null
if null String input
+ * {@code null} if null String input
* @since 2.1
*/
public static String remove(String str, char remove) {
@@ -3786,7 +3786,7 @@ public static String remove(String str, char remove) {
/**
* Replaces a String with another String inside a larger String, once.
*
- * A null
reference passed to this method is a no-op.
+ * A {@code null} reference passed to this method is a no-op.
*
*
* StringUtils.replaceOnce(null, *, *) = null
@@ -3804,7 +3804,7 @@ public static String remove(String str, char remove) {
* @param searchString the String to search for, may be null
* @param replacement the String to replace with, may be null
* @return the text with any replacements processed,
- * null
if null String input
+ * {@code null} if null String input
*/
public static String replaceOnce(String text, String searchString, String replacement) {
return replace(text, searchString, replacement, 1);
@@ -3813,7 +3813,7 @@ public static String replaceOnce(String text, String searchString, String replac
/**
* Replaces all occurrences of a String within another String.
*
- * A null
reference passed to this method is a no-op.
+ * A {@code null} reference passed to this method is a no-op.
*
*
* StringUtils.replace(null, *, *) = null
@@ -3831,7 +3831,7 @@ public static String replaceOnce(String text, String searchString, String replac
* @param searchString the String to search for, may be null
* @param replacement the String to replace it with, may be null
* @return the text with any replacements processed,
- * null
if null String input
+ * {@code null} if null String input
*/
public static String replace(String text, String searchString, String replacement) {
return replace(text, searchString, replacement, -1);
@@ -3839,9 +3839,9 @@ public static String replace(String text, String searchString, String replacemen
/**
* Replaces a String with another String inside a larger String,
- * for the first max
values of the search String.
+ * for the first {@code max} values of the search String.
*
- * A null
reference passed to this method is a no-op.
+ * A {@code null} reference passed to this method is a no-op.
*
*
* StringUtils.replace(null, *, *, *) = null
@@ -3861,9 +3861,9 @@ public static String replace(String text, String searchString, String replacemen
* @param text text to search and replace in, may be null
* @param searchString the String to search for, may be null
* @param replacement the String to replace it with, may be null
- * @param max maximum number of values to replace, or -1
if no maximum
+ * @param max maximum number of values to replace, or {@code -1} if no maximum
* @return the text with any replacements processed,
- * null
if null String input
+ * {@code null} if null String input
*/
public static String replace(String text, String searchString, String replacement, int max) {
if (isEmpty(text) || isEmpty(searchString) || replacement == null || max == 0) {
@@ -3897,7 +3897,7 @@ public static String replace(String text, String searchString, String replacemen
*
*
*
- * A null
reference passed to this method is a no-op, or if
+ * A {@code null} reference passed to this method is a no-op, or if
* any "search string" or "string to replace" is null, that replace will be
* ignored. This will not repeat. For repeating replaces, call the
* overloaded method.
@@ -3923,7 +3923,7 @@ public static String replace(String text, String searchString, String replacemen
* the Strings to search for, no-op if null
* @param replacementList
* the Strings to replace them with, no-op if null
- * @return the text with any replacements processed, null
if
+ * @return the text with any replacements processed, {@code null} if
* null String input
* @throws IndexOutOfBoundsException
* if the lengths of the arrays are not the same (null is ok,
@@ -3940,7 +3940,7 @@ public static String replaceEach(String text, String[] searchList, String[] repl
*
*
*
- * A null
reference passed to this method is a no-op, or if
+ * A {@code null} reference passed to this method is a no-op, or if
* any "search string" or "string to replace" is null, that replace will be
* ignored. This will not repeat. For repeating replaces, call the
* overloaded method.
@@ -3969,7 +3969,7 @@ public static String replaceEach(String text, String[] searchList, String[] repl
* the Strings to search for, no-op if null
* @param replacementList
* the Strings to replace them with, no-op if null
- * @return the text with any replacements processed, null
if
+ * @return the text with any replacements processed, {@code null} if
* null String input
* @throws IllegalArgumentException
* if the search is repeating and there is an endless loop due
@@ -3992,7 +3992,7 @@ public static String replaceEachRepeatedly(String text, String[] searchList, Str
*
*
*
- * A null
reference passed to this method is a no-op, or if
+ * A {@code null} reference passed to this method is a no-op, or if
* any "search string" or "string to replace" is null, that replace will be
* ignored.
*
@@ -4024,7 +4024,7 @@ public static String replaceEachRepeatedly(String text, String[] searchList, Str
* @param timeToLive
* if less than 0 then there is a circular reference and endless
* loop
- * @return the text with any replacements processed, null
if
+ * @return the text with any replacements processed, {@code null} if
* null String input
* @throws IllegalArgumentException
* if the search is repeating and there is an endless loop due
@@ -4167,7 +4167,7 @@ private static String replaceEach(
* Replaces all occurrences of a character in a String with another.
* This is a null-safe version of {@link String#replace(char, char)}.
*
- * A null
string input returns null
.
+ *
A {@code null} string input returns {@code null}.
* An empty ("") string input returns an empty string.
*
*
@@ -4180,7 +4180,7 @@ private static String replaceEach(
* @param str String to replace characters in, may be null
* @param searchChar the character to search for, may be null
* @param replaceChar the character to replace, may be null
- * @return modified String, null
if null string input
+ * @return modified String, {@code null} if null string input
* @since 2.0
*/
public static String replaceChars(String str, char searchChar, char replaceChar) {
@@ -4197,7 +4197,7 @@ public static String replaceChars(String str, char searchChar, char replaceChar)
* For example:
* replaceChars("hello", "ho", "jy") = jelly
.
*
- * A null
string input returns null
.
+ *
A {@code null} string input returns {@code null}.
* An empty ("") string input returns an empty string.
* A null or empty set of search characters returns the input string.
*
@@ -4223,7 +4223,7 @@ public static String replaceChars(String str, char searchChar, char replaceChar)
* @param str String to replace characters in, may be null
* @param searchChars a set of characters to search for, may be null
* @param replaceChars a set of characters to replace, may be null
- * @return modified String, null
if null string input
+ * @return modified String, {@code null} if null string input
* @since 2.0
*/
public static String replaceChars(String str, String searchChars, String replaceChars) {
@@ -4260,7 +4260,7 @@ public static String replaceChars(String str, String searchChars, String replace
/**
* Overlays part of a String with another String.
*
- * A null
string input returns null
.
+ *
A {@code null} string input returns {@code null}.
* A negative index is treated as zero.
* An index greater than the string length is treated as the string length.
* The start index is always the smaller of the two indices.
@@ -4283,7 +4283,7 @@ public static String replaceChars(String str, String searchChars, String replace
* @param overlay the String to overlay, may be null
* @param start the position to start overlaying at
* @param end the position to stop overlaying before
- * @return overlayed String, null
if null String input
+ * @return overlayed String, {@code null} if null String input
* @since 2.0
*/
public static String overlay(String str, String overlay, int start, int end) {
@@ -4322,8 +4322,8 @@ public static String overlay(String str, String overlay, int start, int end) {
//-----------------------------------------------------------------------
/**
* Removes one newline from end of a String if it's there,
- * otherwise leave it alone. A newline is "\n
",
- * "\r
", or "\r\n
".
+ * otherwise leave it alone. A newline is "{@code \n}",
+ * "{@code \r}", or "{@code \r\n}".
*
* NOTE: This method changed in 2.0.
* It now more closely matches Perl chomp.
@@ -4343,7 +4343,7 @@ public static String overlay(String str, String overlay, int start, int end) {
*
*
* @param str the String to chomp a newline from, may be null
- * @return String without newline, null
if null String input
+ * @return String without newline, {@code null} if null String input
*/
public static String chomp(String str) {
if (isEmpty(str)) {
@@ -4372,8 +4372,8 @@ public static String chomp(String str) {
}
/**
- * Removes separator
from the end of
- * str
if it's there, otherwise leave it alone.
+ * Removes {@code separator} from the end of
+ * {@code str} if it's there, otherwise leave it alone.
*
* NOTE: This method changed in version 2.0.
* It now more closely matches Perl chomp.
@@ -4395,7 +4395,7 @@ public static String chomp(String str) {
*
* @param str the String to chomp from, may be null
* @param separator separator String, may be null
- * @return String without trailing separator, null
if null String input
+ * @return String without trailing separator, {@code null} if null String input
*/
public static String chomp(String str, String separator) {
if (isEmpty(str) || separator == null) {
@@ -4412,7 +4412,7 @@ public static String chomp(String str, String separator) {
/**
*
Remove the last character from a String.
*
- * If the String ends in \r\n
, then remove both
+ *
If the String ends in {@code \r\n}, then remove both
* of them.
*
*
@@ -4430,7 +4430,7 @@ public static String chomp(String str, String separator) {
*
*
* @param str the String to chop last character from, may be null
- * @return String without last character, null
if null String input
+ * @return String without last character, {@code null} if null String input
*/
public static String chop(String str) {
if (str == null) {
@@ -4457,7 +4457,7 @@ public static String chop(String str) {
// Padding
//-----------------------------------------------------------------------
/**
- * Repeat a String repeat
times to form a
+ *
Repeat a String {@code repeat} times to form a
* new String.
*
*
@@ -4472,7 +4472,7 @@ public static String chop(String str) {
* @param str the String to repeat, may be null
* @param repeat number of times to repeat str, negative treated as zero
* @return a new String consisting of the original String repeated,
- * null
if null String input
+ * {@code null} if null String input
*/
public static String repeat(String str, int repeat) {
// Performance tuned for 2.0 (JDK1.4)
@@ -4519,7 +4519,7 @@ public static String repeat(String str, int repeat) {
}
/**
- * Repeat a String repeat
times to form a
+ *
Repeat a String {@code repeat} times to form a
* new String, with a String separator injected each time.
*
*
@@ -4535,7 +4535,7 @@ public static String repeat(String str, int repeat) {
* @param separator the String to inject, may be null
* @param repeat number of times to repeat str, negative treated as zero
* @return a new String consisting of the original String repeated,
- * null
if null String input
+ * {@code null} if null String input
* @since 2.5
*/
public static String repeat(String str, String separator, int repeat) {
@@ -4560,7 +4560,7 @@ public static String repeat(String str, String separator, int repeat) {
*
* Note: this method doesn't not support padding with
* Unicode Supplementary Characters
- * as they require a pair of char
s to be represented.
+ * as they require a pair of {@code char}s to be represented.
* If you are needing to support full I18N of your applications
* consider using {@link #repeat(String, int)} instead.
*
@@ -4585,7 +4585,7 @@ private static String padding(int repeat, char padChar) throws IndexOutOfBoundsE
/**
* Right pad a String with spaces (' ').
*
- * The String is padded to the size of size
.
+ * The String is padded to the size of {@code size}.
*
*
* StringUtils.rightPad(null, *) = null
@@ -4599,7 +4599,7 @@ private static String padding(int repeat, char padChar) throws IndexOutOfBoundsE
* @param str the String to pad out, may be null
* @param size the size to pad to
* @return right padded String or original String if no padding is necessary,
- * null
if null String input
+ * {@code null} if null String input
*/
public static String rightPad(String str, int size) {
return rightPad(str, size, ' ');
@@ -4608,7 +4608,7 @@ public static String rightPad(String str, int size) {
/**
* Right pad a String with a specified character.
*
- * The String is padded to the size of size
.
+ * The String is padded to the size of {@code size}.
*
*
* StringUtils.rightPad(null, *, *) = null
@@ -4623,7 +4623,7 @@ public static String rightPad(String str, int size) {
* @param size the size to pad to
* @param padChar the character to pad with
* @return right padded String or original String if no padding is necessary,
- * null
if null String input
+ * {@code null} if null String input
* @since 2.0
*/
public static String rightPad(String str, int size, char padChar) {
@@ -4643,7 +4643,7 @@ public static String rightPad(String str, int size, char padChar) {
/**
* Right pad a String with a specified String.
*
- * The String is padded to the size of size
.
+ * The String is padded to the size of {@code size}.
*
*
* StringUtils.rightPad(null, *, *) = null
@@ -4661,7 +4661,7 @@ public static String rightPad(String str, int size, char padChar) {
* @param size the size to pad to
* @param padStr the String to pad with, null or empty treated as single space
* @return right padded String or original String if no padding is necessary,
- * null
if null String input
+ * {@code null} if null String input
*/
public static String rightPad(String str, int size, String padStr) {
if (str == null) {
@@ -4697,7 +4697,7 @@ public static String rightPad(String str, int size, String padStr) {
/**
* Left pad a String with spaces (' ').
*
- * The String is padded to the size of size
.
+ * The String is padded to the size of {@code size}.
*
*
* StringUtils.leftPad(null, *) = null
@@ -4711,7 +4711,7 @@ public static String rightPad(String str, int size, String padStr) {
* @param str the String to pad out, may be null
* @param size the size to pad to
* @return left padded String or original String if no padding is necessary,
- * null
if null String input
+ * {@code null} if null String input
*/
public static String leftPad(String str, int size) {
return leftPad(str, size, ' ');
@@ -4720,7 +4720,7 @@ public static String leftPad(String str, int size) {
/**
* Left pad a String with a specified character.
*
- * Pad to a size of size
.
+ * Pad to a size of {@code size}.
*
*
* StringUtils.leftPad(null, *, *) = null
@@ -4735,7 +4735,7 @@ public static String leftPad(String str, int size) {
* @param size the size to pad to
* @param padChar the character to pad with
* @return left padded String or original String if no padding is necessary,
- * null
if null String input
+ * {@code null} if null String input
* @since 2.0
*/
public static String leftPad(String str, int size, char padChar) {
@@ -4755,7 +4755,7 @@ public static String leftPad(String str, int size, char padChar) {
/**
* Left pad a String with a specified String.
*
- * Pad to a size of size
.
+ * Pad to a size of {@code size}.
*
*
* StringUtils.leftPad(null, *, *) = null
@@ -4773,7 +4773,7 @@ public static String leftPad(String str, int size, char padChar) {
* @param size the size to pad to
* @param padStr the String to pad with, null or empty treated as single space
* @return left padded String or original String if no padding is necessary,
- * null
if null String input
+ * {@code null} if null String input
*/
public static String leftPad(String str, int size, String padStr) {
if (str == null) {
@@ -4807,13 +4807,13 @@ public static String leftPad(String str, int size, String padStr) {
}
/**
- * Gets a CharSequence length or 0
if the CharSequence is
- * null
.
+ * Gets a CharSequence length or {@code 0} if the CharSequence is
+ * {@code null}.
*
* @param cs
- * a CharSequence or null
- * @return CharSequence length or 0
if the CharSequence is
- * null
.
+ * a CharSequence or {@code null}
+ * @return CharSequence length or {@code 0} if the CharSequence is
+ * {@code null}.
* @since 2.4
* @since 3.0 Changed signature from length(String) to length(CharSequence)
*/
@@ -4824,14 +4824,14 @@ public static int length(CharSequence cs) {
// Centering
//-----------------------------------------------------------------------
/**
- * Centers a String in a larger String of size size
+ *
Centers a String in a larger String of size {@code size}
* using the space character (' ').
*
*
If the size is less than the String length, the String is returned.
- * A null
String returns null
.
+ * A {@code null} String returns {@code null}.
* A negative size is treated as zero.
*
- * Equivalent to center(str, size, " ")
.
+ * Equivalent to {@code center(str, size, " ")}.
*
*
* StringUtils.center(null, *) = null
@@ -4844,18 +4844,18 @@ public static int length(CharSequence cs) {
*
* @param str the String to center, may be null
* @param size the int size of new String, negative treated as zero
- * @return centered String, null
if null String input
+ * @return centered String, {@code null} if null String input
*/
public static String center(String str, int size) {
return center(str, size, ' ');
}
/**
- * Centers a String in a larger String of size size
.
+ *
Centers a String in a larger String of size {@code size}.
* Uses a supplied character as the value to pad the String with.
*
* If the size is less than the String length, the String is returned.
- * A null
String returns null
.
+ * A {@code null} String returns {@code null}.
* A negative size is treated as zero.
*
*
@@ -4871,7 +4871,7 @@ public static String center(String str, int size) {
* @param str the String to center, may be null
* @param size the int size of new String, negative treated as zero
* @param padChar the character to pad the new String with
- * @return centered String, null
if null String input
+ * @return centered String, {@code null} if null String input
* @since 2.0
*/
public static String center(String str, int size, char padChar) {
@@ -4889,11 +4889,11 @@ public static String center(String str, int size, char padChar) {
}
/**
- * Centers a String in a larger String of size size
.
+ *
Centers a String in a larger String of size {@code size}.
* Uses a supplied String as the value to pad the String with.
*
* If the size is less than the String length, the String is returned.
- * A null
String returns null
.
+ * A {@code null} String returns {@code null}.
* A negative size is treated as zero.
*
*
@@ -4911,8 +4911,8 @@ public static String center(String str, int size, char padChar) {
* @param str the String to center, may be null
* @param size the int size of new String, negative treated as zero
* @param padStr the String to pad the new String with, must not be null or empty
- * @return centered String, null
if null String input
- * @throws IllegalArgumentException if padStr is null
or empty
+ * @return centered String, {@code null} if null String input
+ * @throws IllegalArgumentException if padStr is {@code null} or empty
*/
public static String center(String str, int size, String padStr) {
if (str == null || size <= 0) {
@@ -4936,7 +4936,7 @@ public static String center(String str, int size, String padStr) {
/**
* Converts a String to upper case as per {@link String#toUpperCase()}.
*
- * A null
input String returns null
.
+ * A {@code null} input String returns {@code null}.
*
*
* StringUtils.upperCase(null) = null
@@ -4950,7 +4950,7 @@ public static String center(String str, int size, String padStr) {
* should be used with a specific locale (e.g. {@link Locale#ENGLISH}).
*
* @param str the String to upper case, may be null
- * @return the upper cased String, null
if null String input
+ * @return the upper cased String, {@code null} if null String input
*/
public static String upperCase(String str) {
if (str == null) {
@@ -4962,7 +4962,7 @@ public static String upperCase(String str) {
/**
* Converts a String to upper case as per {@link String#toUpperCase(Locale)}.
*
- * A null
input String returns null
.
+ * A {@code null} input String returns {@code null}.
*
*
* StringUtils.upperCase(null, Locale.ENGLISH) = null
@@ -4972,7 +4972,7 @@ public static String upperCase(String str) {
*
* @param str the String to upper case, may be null
* @param locale the locale that defines the case transformation rules, must not be null
- * @return the upper cased String, null
if null String input
+ * @return the upper cased String, {@code null} if null String input
* @since 2.5
*/
public static String upperCase(String str, Locale locale) {
@@ -4985,7 +4985,7 @@ public static String upperCase(String str, Locale locale) {
/**
* Converts a String to lower case as per {@link String#toLowerCase()}.
*
- * A null
input String returns null
.
+ * A {@code null} input String returns {@code null}.
*
*
* StringUtils.lowerCase(null) = null
@@ -4999,7 +4999,7 @@ public static String upperCase(String str, Locale locale) {
* should be used with a specific locale (e.g. {@link Locale#ENGLISH}).
*
* @param str the String to lower case, may be null
- * @return the lower cased String, null
if null String input
+ * @return the lower cased String, {@code null} if null String input
*/
public static String lowerCase(String str) {
if (str == null) {
@@ -5011,7 +5011,7 @@ public static String lowerCase(String str) {
/**
* Converts a String to lower case as per {@link String#toLowerCase(Locale)}.
*
- * A null
input String returns null
.
+ * A {@code null} input String returns {@code null}.
*
*
* StringUtils.lowerCase(null, Locale.ENGLISH) = null
@@ -5021,7 +5021,7 @@ public static String lowerCase(String str) {
*
* @param str the String to lower case, may be null
* @param locale the locale that defines the case transformation rules, must not be null
- * @return the lower cased String, null
if null String input
+ * @return the lower cased String, {@code null} if null String input
* @since 2.5
*/
public static String lowerCase(String str, Locale locale) {
@@ -5036,7 +5036,7 @@ public static String lowerCase(String str, Locale locale) {
* per {@link Character#toTitleCase(char)}. No other letters are changed.
*
* For a word based algorithm, see {@link org.apache.commons.lang3.text.WordUtils#capitalize(String)}.
- * A null
input String returns null
.
+ * A {@code null} input String returns {@code null}.
*
*
* StringUtils.capitalize(null) = null
@@ -5046,7 +5046,7 @@ public static String lowerCase(String str, Locale locale) {
*
*
* @param cs the String to capitalize, may be null
- * @return the capitalized String, null
if null String input
+ * @return the capitalized String, {@code null} if null String input
* @see org.apache.commons.lang3.text.WordUtils#capitalize(String)
* @see #uncapitalize(CharSequence)
* @since 2.0
@@ -5071,7 +5071,7 @@ public static String capitalize(CharSequence cs) {
* per {@link Character#toLowerCase(char)}. No other letters are changed.
*
* For a word based algorithm, see {@link org.apache.commons.lang3.text.WordUtils#uncapitalize(String)}.
- * A null
input String returns null
.
+ * A {@code null} input String returns {@code null}.
*
*
* StringUtils.uncapitalize(null) = null
@@ -5081,7 +5081,7 @@ public static String capitalize(CharSequence cs) {
*
*
* @param cs the String to uncapitalize, may be null
- * @return the uncapitalized String, null
if null String input
+ * @return the uncapitalized String, {@code null} if null String input
* @see org.apache.commons.lang3.text.WordUtils#uncapitalize(String)
* @see #capitalize(CharSequence)
* @since 2.0
@@ -5112,7 +5112,7 @@ public static String uncapitalize(CharSequence cs) {
*
*
* For a word based algorithm, see {@link org.apache.commons.lang3.text.WordUtils#swapCase(String)}.
- * A null
input String returns null
.
+ * A {@code null} input String returns {@code null}.
*
*
* StringUtils.swapCase(null) = null
@@ -5126,7 +5126,7 @@ public static String uncapitalize(CharSequence cs) {
* That functionality is available in org.apache.commons.lang3.text.WordUtils.
*
* @param str the String to swap case, may be null
- * @return the changed String, null
if null String input
+ * @return the changed String, {@code null} if null String input
*/
public static String swapCase(String str) {
int strLen;
@@ -5155,7 +5155,7 @@ public static String swapCase(String str) {
/**
* Counts how many times the substring appears in the larger String.
*
- * A null
or empty ("") String input returns 0
.
+ * A {@code null} or empty ("") String input returns {@code 0}.
*
*
* StringUtils.countMatches(null, *) = 0
@@ -5169,7 +5169,7 @@ public static String swapCase(String str) {
*
* @param str the String to check, may be null
* @param sub the substring to count, may be null
- * @return the number of occurrences, 0 if either String is null
+ * @return the number of occurrences, 0 if either String is {@code null}
*/
public static int countMatches(String str, String sub) {
if (isEmpty(str) || isEmpty(sub)) {
@@ -5189,8 +5189,8 @@ public static int countMatches(String str, String sub) {
/**
* Checks if the CharSequence contains only unicode letters.
*
- * null
will return false
.
- * An empty CharSequence (length()=0) will return false
.
+ * {@code null} will return {@code false}.
+ * An empty CharSequence (length()=0) will return {@code false}.
*
*
* StringUtils.isAlpha(null) = false
@@ -5202,7 +5202,7 @@ public static int countMatches(String str, String sub) {
*
*
* @param cs the CharSequence to check, may be null
- * @return true
if only contains letters, and is non-null
+ * @return {@code true} if only contains letters, and is non-null
* @since 3.0 Changed signature from isAlpha(String) to isAlpha(CharSequence)
* @since 3.0 Changed "" to return false and not true
*/
@@ -5223,8 +5223,8 @@ public static boolean isAlpha(CharSequence cs) {
* Checks if the CharSequence contains only unicode letters and
* space (' ').
*
- * null
will return false
- * An empty CharSequence (length()=0) will return true
.
+ * {@code null} will return {@code false}
+ * An empty CharSequence (length()=0) will return {@code true}.
*
*
* StringUtils.isAlphaSpace(null) = false
@@ -5237,7 +5237,7 @@ public static boolean isAlpha(CharSequence cs) {
*
*
* @param cs the CharSequence to check, may be null
- * @return true
if only contains letters and space,
+ * @return {@code true} if only contains letters and space,
* and is non-null
* @since 3.0 Changed signature from isAlphaSpace(String) to isAlphaSpace(CharSequence)
*/
@@ -5257,8 +5257,8 @@ public static boolean isAlphaSpace(CharSequence cs) {
/**
* Checks if the CharSequence contains only unicode letters or digits.
*
- * null
will return false
.
- * An empty CharSequence (length()=0) will return false
.
+ * {@code null} will return {@code false}.
+ * An empty CharSequence (length()=0) will return {@code false}.
*
*
* StringUtils.isAlphanumeric(null) = false
@@ -5271,7 +5271,7 @@ public static boolean isAlphaSpace(CharSequence cs) {
*
*
* @param cs the CharSequence to check, may be null
- * @return true
if only contains letters or digits,
+ * @return {@code true} if only contains letters or digits,
* and is non-null
* @since 3.0 Changed signature from isAlphanumeric(String) to isAlphanumeric(CharSequence)
* @since 3.0 Changed "" to return false and not true
@@ -5291,10 +5291,10 @@ public static boolean isAlphanumeric(CharSequence cs) {
/**
* Checks if the CharSequence contains only unicode letters, digits
- * or space (' '
).
+ * or space ({@code ' '}).
*
- * null
will return false
.
- * An empty CharSequence (length()=0) will return true
.
+ * {@code null} will return {@code false}.
+ * An empty CharSequence (length()=0) will return {@code true}.
*
*
* StringUtils.isAlphanumericSpace(null) = false
@@ -5307,7 +5307,7 @@ public static boolean isAlphanumeric(CharSequence cs) {
*
*
* @param cs the CharSequence to check, may be null
- * @return true
if only contains letters, digits or space,
+ * @return {@code true} if only contains letters, digits or space,
* and is non-null
* @since 3.0 Changed signature from isAlphanumericSpace(String) to isAlphanumericSpace(CharSequence)
*/
@@ -5327,8 +5327,8 @@ public static boolean isAlphanumericSpace(CharSequence cs) {
/**
* Checks if the CharSequence contains only ASCII printable characters.
*
- * null
will return false
.
- * An empty CharSequence (length()=0) will return true
.
+ * {@code null} will return {@code false}.
+ * An empty CharSequence (length()=0) will return {@code true}.
*
*
* StringUtils.isAsciiPrintable(null) = false
@@ -5345,7 +5345,7 @@ public static boolean isAlphanumericSpace(CharSequence cs) {
*
*
* @param cs the CharSequence to check, may be null
- * @return true
if every character is in the range
+ * @return {@code true} if every character is in the range
* 32 thru 126
* @since 2.1
* @since 3.0 Changed signature from isAsciiPrintable(String) to isAsciiPrintable(CharSequence)
@@ -5367,8 +5367,8 @@ public static boolean isAsciiPrintable(CharSequence cs) {
* Checks if the CharSequence contains only unicode digits.
* A decimal point is not a unicode digit and returns false.
*
- * null
will return false
.
- * An empty CharSequence (length()=0) will return false
.
+ * {@code null} will return {@code false}.
+ * An empty CharSequence (length()=0) will return {@code false}.
*
*
* StringUtils.isNumeric(null) = false
@@ -5382,7 +5382,7 @@ public static boolean isAsciiPrintable(CharSequence cs) {
*
*
* @param cs the CharSequence to check, may be null
- * @return true
if only contains digits, and is non-null
+ * @return {@code true} if only contains digits, and is non-null
* @since 3.0 Changed signature from isNumeric(String) to isNumeric(CharSequence)
* @since 3.0 Changed "" to return false and not true
*/
@@ -5401,11 +5401,11 @@ public static boolean isNumeric(CharSequence cs) {
/**
* Checks if the CharSequence contains only unicode digits or space
- * (' '
).
+ * ({@code ' '}).
* A decimal point is not a unicode digit and returns false.
*
- * null
will return false
.
- * An empty CharSequence (length()=0) will return true
.
+ * {@code null} will return {@code false}.
+ * An empty CharSequence (length()=0) will return {@code true}.
*
*
* StringUtils.isNumericSpace(null) = false
@@ -5419,7 +5419,7 @@ public static boolean isNumeric(CharSequence cs) {
*
*
* @param cs the CharSequence to check, may be null
- * @return true
if only contains digits or space,
+ * @return {@code true} if only contains digits or space,
* and is non-null
* @since 3.0 Changed signature from isNumericSpace(String) to isNumericSpace(CharSequence)
*/
@@ -5439,8 +5439,8 @@ public static boolean isNumericSpace(CharSequence cs) {
/**
* Checks if the CharSequence contains only whitespace.
*
- * null
will return false
.
- * An empty CharSequence (length()=0) will return true
.
+ * {@code null} will return {@code false}.
+ * An empty CharSequence (length()=0) will return {@code true}.
*
*
* StringUtils.isWhitespace(null) = false
@@ -5452,7 +5452,7 @@ public static boolean isNumericSpace(CharSequence cs) {
*
*
* @param cs the CharSequence to check, may be null
- * @return true
if only contains whitespace, and is non-null
+ * @return {@code true} if only contains whitespace, and is non-null
* @since 2.0
* @since 3.0 Changed signature from isWhitespace(String) to isWhitespace(CharSequence)
*/
@@ -5472,8 +5472,8 @@ public static boolean isWhitespace(CharSequence cs) {
/**
* Checks if the CharSequence contains only lowercase characters.
*
- * null
will return false
.
- * An empty CharSequence (length()=0) will return false
.
+ * {@code null} will return {@code false}.
+ * An empty CharSequence (length()=0) will return {@code false}.
*
*
* StringUtils.isAllLowerCase(null) = false
@@ -5484,7 +5484,7 @@ public static boolean isWhitespace(CharSequence cs) {
*
*
* @param cs the CharSequence to check, may be null
- * @return true
if only contains lowercase characters, and is non-null
+ * @return {@code true} if only contains lowercase characters, and is non-null
* @since 2.5
* @since 3.0 Changed signature from isAllLowerCase(String) to isAllLowerCase(CharSequence)
*/
@@ -5504,8 +5504,8 @@ public static boolean isAllLowerCase(CharSequence cs) {
/**
* Checks if the CharSequence contains only uppercase characters.
*
- * null
will return false
.
- * An empty String (length()=0) will return false
.
+ * {@code null} will return {@code false}.
+ * An empty String (length()=0) will return {@code false}.
*
*
* StringUtils.isAllUpperCase(null) = false
@@ -5516,7 +5516,7 @@ public static boolean isAllLowerCase(CharSequence cs) {
*
*
* @param cs the CharSequence to check, may be null
- * @return true
if only contains uppercase characters, and is non-null
+ * @return {@code true} if only contains uppercase characters, and is non-null
* @since 2.5
* @since 3.0 Changed signature from isAllUpperCase(String) to isAllUpperCase(CharSequence)
*/
@@ -5537,7 +5537,7 @@ public static boolean isAllUpperCase(CharSequence cs) {
//-----------------------------------------------------------------------
/**
* Returns either the passed in String,
- * or if the String is null
, an empty String ("").
+ * or if the String is {@code null}, an empty String ("").
*
*
* StringUtils.defaultString(null) = ""
@@ -5549,7 +5549,7 @@ public static boolean isAllUpperCase(CharSequence cs) {
* @see String#valueOf(Object)
* @param str the String to check, may be null
* @return the passed in String, or the empty String if it
- * was null
+ * was {@code null}
*/
public static String defaultString(String str) {
return str == null ? EMPTY : str;
@@ -5557,7 +5557,7 @@ public static String defaultString(String str) {
/**
* Returns either the passed in String, or if the String is
- * null
, the value of defaultStr
.
+ * {@code null}, the value of {@code defaultStr}.
*
*
* StringUtils.defaultString(null, "NULL") = "NULL"
@@ -5569,8 +5569,8 @@ public static String defaultString(String str) {
* @see String#valueOf(Object)
* @param str the String to check, may be null
* @param defaultStr the default String to return
- * if the input is null
, may be null
- * @return the passed in String, or the default if it was null
+ * if the input is {@code null}, may be null
+ * @return the passed in String, or the default if it was {@code null}
*/
public static String defaultString(String str, String defaultStr) {
return str == null ? defaultStr : str;
@@ -5578,7 +5578,7 @@ public static String defaultString(String str, String defaultStr) {
/**
* Returns either the passed in CharSequence, or if the CharSequence is
- * whitespace, empty ("") or null
, the value of defaultStr
.
+ * whitespace, empty ("") or {@code null}, the value of {@code defaultStr}.
*
*
* StringUtils.defaultIfBlank(null, "NULL") = "NULL"
@@ -5590,7 +5590,7 @@ public static String defaultString(String str, String defaultStr) {
* @param the specific kind of CharSequence
* @param str the CharSequence to check, may be null
* @param defaultStr the default CharSequence to return
- * if the input is whitespace, empty ("") or null
, may be null
+ * if the input is whitespace, empty ("") or {@code null}, may be null
* @return the passed in CharSequence, or the default
* @see StringUtils#defaultString(String, String)
*/
@@ -5600,7 +5600,7 @@ public static T defaultIfBlank(T str, T defaultStr) {
/**
* Returns either the passed in CharSequence, or if the CharSequence is
- * empty or null
, the value of defaultStr
.
+ * empty or {@code null}, the value of {@code defaultStr}.
*
*
* StringUtils.defaultIfEmpty(null, "NULL") = "NULL"
@@ -5611,7 +5611,7 @@ public static T defaultIfBlank(T str, T defaultStr) {
* @param the specific kind of CharSequence
* @param str the CharSequence to check, may be null
* @param defaultStr the default CharSequence to return
- * if the input is empty ("") or null
, may be null
+ * if the input is empty ("") or {@code null}, may be null
* @return the passed in CharSequence, or the default
* @see StringUtils#defaultString(String, String)
*/
@@ -5624,7 +5624,7 @@ public static T defaultIfEmpty(T str, T defaultStr) {
/**
* Reverses a String as per {@link StringBuilder#reverse()}.
*
- * A null
String returns null
.
+ * A {@code null} String returns {@code null}.
*
*
* StringUtils.reverse(null) = null
@@ -5633,7 +5633,7 @@ public static T defaultIfEmpty(T str, T defaultStr) {
*
*
* @param str the String to reverse, may be null
- * @return the reversed String, null
if null String input
+ * @return the reversed String, {@code null} if null String input
*/
public static String reverse(String str) {
if (str == null) {
@@ -5647,7 +5647,7 @@ public static String reverse(String str) {
*
* The Strings between the delimiters are not reversed.
* Thus java.lang.String becomes String.lang.java (if the delimiter
- * is '.'
).
+ * is {@code '.'}).
*
*
* StringUtils.reverseDelimited(null, *) = null
@@ -5658,7 +5658,7 @@ public static String reverse(String str) {
*
* @param str the String to reverse, may be null
* @param separatorChar the separator character to use
- * @return the reversed String, null
if null String input
+ * @return the reversed String, {@code null} if null String input
* @since 2.0
*/
public static String reverseDelimited(String str, char separatorChar) {
@@ -5680,13 +5680,13 @@ public static String reverseDelimited(String str, char separatorChar) {
*
* Specifically:
*
- * - If
str
is less than maxWidth
characters
+ * - If {@code str} is less than {@code maxWidth} characters
* long, return it.
- * - Else abbreviate it to
(substring(str, 0, max-3) + "...")
.
- * - If
maxWidth
is less than 4
, throw an
- * IllegalArgumentException
.
+ * - Else abbreviate it to {@code (substring(str, 0, max-3) + "...")}.
+ * - If {@code maxWidth} is less than {@code 4}, throw an
+ * {@code IllegalArgumentException}.
* - In no case will it return a String of length greater than
- *
maxWidth
.
+ * {@code maxWidth}.
*
*
*
@@ -5702,7 +5702,7 @@ public static String reverseDelimited(String str, char separatorChar) {
*
* @param str the String to check, may be null
* @param maxWidth maximum length of result String, must be at least 4
- * @return abbreviated String, null
if null String input
+ * @return abbreviated String, {@code null} if null String input
* @throws IllegalArgumentException if the width is too small
* @since 2.0
*/
@@ -5714,13 +5714,13 @@ public static String abbreviate(String str, int maxWidth) {
* Abbreviates a String using ellipses. This will turn
* "Now is the time for all good men" into "...is the time for..."
*
- * Works like abbreviate(String, int)
, but allows you to specify
+ *
Works like {@code abbreviate(String, int)}, but allows you to specify
* a "left edge" offset. Note that this left edge is not necessarily going to
* be the leftmost character in the result, or the first character following the
* ellipses, but it will appear somewhere in the result.
*
*
In no case will it return a String of length greater than
- * maxWidth
.
+ * {@code maxWidth}.
*
*
* StringUtils.abbreviate(null, *, *) = null
@@ -5741,7 +5741,7 @@ public static String abbreviate(String str, int maxWidth) {
* @param str the String to check, may be null
* @param offset left edge of source String
* @param maxWidth maximum length of result String, must be at least 4
- * @return abbreviated String, null
if null String input
+ * @return abbreviated String, {@code null} if null String input
* @throws IllegalArgumentException if the width is too small
* @since 2.0
*/
@@ -5799,7 +5799,7 @@ public static String abbreviate(String str, int offset, int maxWidth) {
*
* @param str the String to abbreviate, may be null
* @param middle the String to replace the middle characters with, may be null
- * @param length the length to abbreviate str
to.
+ * @param length the length to abbreviate {@code str} to.
* @return the abbreviated String if the above criteria is met, or the original String supplied for abbreviation.
* @since 2.5
*/
@@ -5832,7 +5832,7 @@ public static String abbreviateMiddle(String str, String middle, int length) {
* starting from where it's different from the first.)
*
* For example,
- * difference("i am a machine", "i am a robot") -> "robot"
.
+ * {@code difference("i am a machine", "i am a robot") -> "robot"}.
*
*
* StringUtils.difference(null, null) = null
@@ -5870,7 +5870,7 @@ public static String difference(String str1, String str2) {
* CharSequences begin to differ.
*
* For example,
- * indexOfDifference("i am a machine", "i am a robot") -> 7
+ * {@code indexOfDifference("i am a machine", "i am a robot") -> 7}
*
*
* StringUtils.indexOfDifference(null, null) = -1
@@ -5913,7 +5913,7 @@ public static int indexOfDifference(CharSequence cs1, CharSequence cs2) {
* CharSequences begin to differ.
*
* For example,
- * indexOfDifference(new String[] {"i am a machine", "i am a robot"}) -> 7
+ * {@code indexOfDifference(new String[] {"i am a machine", "i am a robot"}) -> 7}
*
*
* StringUtils.indexOfDifference(null) = -1
@@ -6003,7 +6003,7 @@ public static int indexOfDifference(CharSequence... css) {
* characters that is common to all of them.
*
* For example,
- * getCommonPrefix(new String[] {"i am a machine", "i am a robot"}) -> "i am a "
+ * {@code getCommonPrefix(new String[] {"i am a machine", "i am a robot"}) -> "i am a "}
*
*
* StringUtils.getCommonPrefix(null) = ""
@@ -6085,7 +6085,7 @@ public static String getCommonPrefix(String... strs) {
* @param s the first String, must not be null
* @param t the second String, must not be null
* @return result distance
- * @throws IllegalArgumentException if either String input null
+ * @throws IllegalArgumentException if either String input {@code null}
* @since 3.0 Changed signature from getLevenshteinDistance(String, String) to getLevenshteinDistance(CharSequence, CharSequence)
*/
public static int getLevenshteinDistance(CharSequence s, CharSequence t) {
@@ -6171,7 +6171,7 @@ allows us to retain the previous cost counts as required by the algorithm (takin
/**
* Check if a String starts with a specified prefix.
*
- * null
s are handled without exceptions. Two null
+ *
{@code null}s are handled without exceptions. Two {@code null}
* references are considered to be equal. The comparison is case sensitive.
*
*
@@ -6185,8 +6185,8 @@ allows us to retain the previous cost counts as required by the algorithm (takin
* @see java.lang.String#startsWith(String)
* @param str the String to check, may be null
* @param prefix the prefix to find, may be null
- * @return true
if the String starts with the prefix, case sensitive, or
- * both null
+ * @return {@code true} if the String starts with the prefix, case sensitive, or
+ * both {@code null}
* @since 2.4
*/
public static boolean startsWith(String str, String prefix) {
@@ -6196,7 +6196,7 @@ public static boolean startsWith(String str, String prefix) {
/**
* Case insensitive check if a String starts with a specified prefix.
*
- * null
s are handled without exceptions. Two null
+ *
{@code null}s are handled without exceptions. Two {@code null}
* references are considered to be equal. The comparison is case insensitive.
*
*
@@ -6210,8 +6210,8 @@ public static boolean startsWith(String str, String prefix) {
* @see java.lang.String#startsWith(String)
* @param str the String to check, may be null
* @param prefix the prefix to find, may be null
- * @return true
if the String starts with the prefix, case insensitive, or
- * both null
+ * @return {@code true} if the String starts with the prefix, case insensitive, or
+ * both {@code null}
* @since 2.4
*/
public static boolean startsWithIgnoreCase(String str, String prefix) {
@@ -6226,8 +6226,8 @@ public static boolean startsWithIgnoreCase(String str, String prefix) {
* @param prefix the prefix to find, may be null
* @param ignoreCase inidicates whether the compare should ignore case
* (case insensitive) or not.
- * @return true
if the String starts with the prefix or
- * both null
+ * @return {@code true} if the String starts with the prefix or
+ * both {@code null}
*/
private static boolean startsWith(String str, String prefix, boolean ignoreCase) {
if (str == null || prefix == null) {
@@ -6253,8 +6253,8 @@ private static boolean startsWith(String str, String prefix, boolean ignoreCase)
*
* @param string the String to check, may be null
* @param searchStrings the Strings to find, may be null or empty
- * @return true
if the String starts with any of the the prefixes, case insensitive, or
- * both null
+ * @return {@code true} if the String starts with any of the the prefixes, case insensitive, or
+ * both {@code null}
* @since 2.5
*/
public static boolean startsWithAny(String string, String... searchStrings) {
@@ -6276,7 +6276,7 @@ public static boolean startsWithAny(String string, String... searchStrings) {
/**
* Check if a String ends with a specified suffix.
*
- * null
s are handled without exceptions. Two null
+ *
{@code null}s are handled without exceptions. Two {@code null}
* references are considered to be equal. The comparison is case sensitive.
*
*
@@ -6291,8 +6291,8 @@ public static boolean startsWithAny(String string, String... searchStrings) {
* @see java.lang.String#endsWith(String)
* @param str the String to check, may be null
* @param suffix the suffix to find, may be null
- * @return true
if the String ends with the suffix, case sensitive, or
- * both null
+ * @return {@code true} if the String ends with the suffix, case sensitive, or
+ * both {@code null}
* @since 2.4
*/
public static boolean endsWith(String str, String suffix) {
@@ -6302,7 +6302,7 @@ public static boolean endsWith(String str, String suffix) {
/**
* Case insensitive check if a String ends with a specified suffix.
*
- * null
s are handled without exceptions. Two null
+ *
{@code null}s are handled without exceptions. Two {@code null}
* references are considered to be equal. The comparison is case insensitive.
*
*
@@ -6317,8 +6317,8 @@ public static boolean endsWith(String str, String suffix) {
* @see java.lang.String#endsWith(String)
* @param str the String to check, may be null
* @param suffix the suffix to find, may be null
- * @return true
if the String ends with the suffix, case insensitive, or
- * both null
+ * @return {@code true} if the String ends with the suffix, case insensitive, or
+ * both {@code null}
* @since 2.4
*/
public static boolean endsWithIgnoreCase(String str, String suffix) {
@@ -6333,8 +6333,8 @@ public static boolean endsWithIgnoreCase(String str, String suffix) {
* @param suffix the suffix to find, may be null
* @param ignoreCase inidicates whether the compare should ignore case
* (case insensitive) or not.
- * @return true
if the String starts with the prefix or
- * both null
+ * @return {@code true} if the String starts with the prefix or
+ * both {@code null}
*/
private static boolean endsWith(String str, String suffix, boolean ignoreCase) {
if (str == null || suffix == null) {
@@ -6355,7 +6355,7 @@ private static boolean endsWith(String str, String suffix, boolean ignoreCase) {
*
*
* The function returns the argument string with whitespace normalized by using
- * {@link #trim(String)}
to remove leading and trailing whitespace
+ * {@code {@link #trim(String)}} to remove leading and trailing whitespace
* and then replacing sequences of whitespace characters by a single space.
*
* In XML Whitespace characters are the same as those allowed by the
*
* The difference is that Java's whitespace includes vertical tab and form feed, which this functional will also
- * normalize. Additonally {@link #trim(String)}
removes control characters (char <= 32) from both
+ * normalize. Additonally {@code {@link #trim(String)}} removes control characters (char <= 32) from both
* ends of this String.
*
*
@@ -6384,7 +6384,7 @@ private static boolean endsWith(String str, String suffix, boolean ignoreCase) {
* @see http://www.w3.org/TR/xpath/#function-normalize-space
* @param str the source String to normalize whitespaces from, may be null
- * @return the modified string with whitespace normalized, null
if null String input
+ * @return the modified string with whitespace normalized, {@code null} if null String input
*
* @since 3.0
*/
@@ -6409,8 +6409,8 @@ public static String normalizeSpace(String str) {
*
* @param string the String to check, may be null
* @param searchStrings the Strings to find, may be null or empty
- * @return true
if the String ends with any of the the prefixes, case insensitive, or
- * both null
+ * @return {@code true} if the String ends with any of the the prefixes, case insensitive, or
+ * both {@code null}
* @since 3.1
*/
public static boolean endsWithAny(String string, String... searchStrings) {
diff --git a/src/main/java/org/apache/commons/lang3/SystemUtils.java b/src/main/java/org/apache/commons/lang3/SystemUtils.java
index 2339abc7d..6984a4678 100644
--- a/src/main/java/org/apache/commons/lang3/SystemUtils.java
+++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java
@@ -20,12 +20,12 @@
/**
*
- * Helpers for java.lang.System
.
+ * Helpers for {@code java.lang.System}.
*
*
*
- * If a system property cannot be read due to security restrictions, the corresponding field in this class will be set to null
- * and a message will be written to System.err
.
+ * If a system property cannot be read due to security restrictions, the corresponding field in this class will be set to {@code null}
+ * and a message will be written to {@code System.err}.
*
*
*
@@ -77,17 +77,17 @@ public class SystemUtils {
/**
*
- * The awt.toolkit
System Property.
+ * The {@code awt.toolkit} System Property.
*
*
- * Holds a class name, on Windows XP this is sun.awt.windows.WToolkit
.
+ * Holds a class name, on Windows XP this is {@code sun.awt.windows.WToolkit}.
*
*
- * On platforms without a GUI, this value is null
.
+ * On platforms without a GUI, this value is {@code null}.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -102,14 +102,14 @@ public class SystemUtils {
/**
*
- * The file.encoding
System Property.
+ * The {@code file.encoding} System Property.
*
*
- * File encoding, such as Cp1252
.
+ * File encoding, such as {@code Cp1252}.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -125,11 +125,11 @@ public class SystemUtils {
/**
*
- * The file.separator
System Property. File separator ("/"
on UNIX).
+ * The {@code file.separator} System Property. File separator ("/"
on UNIX).
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -144,11 +144,11 @@ public class SystemUtils {
/**
*
- * The java.awt.fonts
System Property.
+ * The {@code java.awt.fonts} System Property.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -163,11 +163,11 @@ public class SystemUtils {
/**
*
- * The java.awt.graphicsenv
System Property.
+ * The {@code java.awt.graphicsenv} System Property.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -182,12 +182,12 @@ public class SystemUtils {
/**
*
- * The java.awt.headless
System Property. The value of this property is the String "true"
or
- * "false"
.
+ * The {@code java.awt.headless} System Property. The value of this property is the String {@code "true"} or
+ * {@code "false"}.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -204,11 +204,11 @@ public class SystemUtils {
/**
*
- * The java.awt.printerjob
System Property.
+ * The {@code java.awt.printerjob} System Property.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -223,11 +223,11 @@ public class SystemUtils {
/**
*
- * The java.class.path
System Property. Java class path.
+ * The {@code java.class.path} System Property. Java class path.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -242,11 +242,11 @@ public class SystemUtils {
/**
*
- * The java.class.version
System Property. Java class format version number.
+ * The {@code java.class.version} System Property. Java class format version number.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -261,12 +261,12 @@ public class SystemUtils {
/**
*
- * The java.compiler
System Property. Name of JIT compiler to use. First in JDK version 1.2. Not used in Sun JDKs after
+ * The {@code java.compiler} System Property. Name of JIT compiler to use. First in JDK version 1.2. Not used in Sun JDKs after
* 1.2.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -281,11 +281,11 @@ public class SystemUtils {
/**
*
- * The java.endorsed.dirs
System Property. Path of endorsed directory or directories.
+ * The {@code java.endorsed.dirs} System Property. Path of endorsed directory or directories.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -300,11 +300,11 @@ public class SystemUtils {
/**
*
- * The java.ext.dirs
System Property. Path of extension directory or directories.
+ * The {@code java.ext.dirs} System Property. Path of extension directory or directories.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -319,11 +319,11 @@ public class SystemUtils {
/**
*
- * The java.home
System Property. Java installation directory.
+ * The {@code java.home} System Property. Java installation directory.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -338,11 +338,11 @@ public class SystemUtils {
/**
*
- * The java.io.tmpdir
System Property. Default temp file path.
+ * The {@code java.io.tmpdir} System Property. Default temp file path.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -357,11 +357,11 @@ public class SystemUtils {
/**
*
- * The java.library.path
System Property. List of paths to search when loading libraries.
+ * The {@code java.library.path} System Property. List of paths to search when loading libraries.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -376,11 +376,11 @@ public class SystemUtils {
/**
*
- * The java.runtime.name
System Property. Java Runtime Environment name.
+ * The {@code java.runtime.name} System Property. Java Runtime Environment name.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -396,11 +396,11 @@ public class SystemUtils {
/**
*
- * The java.runtime.version
System Property. Java Runtime Environment version.
+ * The {@code java.runtime.version} System Property. Java Runtime Environment version.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -416,11 +416,11 @@ public class SystemUtils {
/**
*
- * The java.specification.name
System Property. Java Runtime Environment specification name.
+ * The {@code java.specification.name} System Property. Java Runtime Environment specification name.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -435,11 +435,11 @@ public class SystemUtils {
/**
*
- * The java.specification.vendor
System Property. Java Runtime Environment specification vendor.
+ * The {@code java.specification.vendor} System Property. Java Runtime Environment specification vendor.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -454,11 +454,11 @@ public class SystemUtils {
/**
*
- * The java.specification.version
System Property. Java Runtime Environment specification version.
+ * The {@code java.specification.version} System Property. Java Runtime Environment specification version.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -474,11 +474,11 @@ public class SystemUtils {
/**
*
- * The java.util.prefs.PreferencesFactory
System Property. A class name.
+ * The {@code java.util.prefs.PreferencesFactory} System Property. A class name.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -494,11 +494,11 @@ public class SystemUtils {
/**
*
- * The java.vendor
System Property. Java vendor-specific string.
+ * The {@code java.vendor} System Property. Java vendor-specific string.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -513,11 +513,11 @@ public class SystemUtils {
/**
*
- * The java.vendor.url
System Property. Java vendor URL.
+ * The {@code java.vendor.url} System Property. Java vendor URL.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -532,11 +532,11 @@ public class SystemUtils {
/**
*
- * The java.version
System Property. Java version number.
+ * The {@code java.version} System Property. Java version number.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -551,11 +551,11 @@ public class SystemUtils {
/**
*
- * The java.vm.info
System Property. Java Virtual Machine implementation info.
+ * The {@code java.vm.info} System Property. Java Virtual Machine implementation info.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -571,11 +571,11 @@ public class SystemUtils {
/**
*
- * The java.vm.name
System Property. Java Virtual Machine implementation name.
+ * The {@code java.vm.name} System Property. Java Virtual Machine implementation name.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -590,11 +590,11 @@ public class SystemUtils {
/**
*
- * The java.vm.specification.name
System Property. Java Virtual Machine specification name.
+ * The {@code java.vm.specification.name} System Property. Java Virtual Machine specification name.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -609,11 +609,11 @@ public class SystemUtils {
/**
*
- * The java.vm.specification.vendor
System Property. Java Virtual Machine specification vendor.
+ * The {@code java.vm.specification.vendor} System Property. Java Virtual Machine specification vendor.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -628,11 +628,11 @@ public class SystemUtils {
/**
*
- * The java.vm.specification.version
System Property. Java Virtual Machine specification version.
+ * The {@code java.vm.specification.version} System Property. Java Virtual Machine specification version.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -647,11 +647,11 @@ public class SystemUtils {
/**
*
- * The java.vm.vendor
System Property. Java Virtual Machine implementation vendor.
+ * The {@code java.vm.vendor} System Property. Java Virtual Machine implementation vendor.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -666,11 +666,11 @@ public class SystemUtils {
/**
*
- * The java.vm.version
System Property. Java Virtual Machine implementation version.
+ * The {@code java.vm.version} System Property. Java Virtual Machine implementation version.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -685,11 +685,11 @@ public class SystemUtils {
/**
*
- * The line.separator
System Property. Line separator ("\n"
on UNIX).
+ * The {@code line.separator} System Property. Line separator ("\n"
on UNIX).
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -704,11 +704,11 @@ public class SystemUtils {
/**
*
- * The os.arch
System Property. Operating system architecture.
+ * The {@code os.arch} System Property. Operating system architecture.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -723,11 +723,11 @@ public class SystemUtils {
/**
*
- * The os.name
System Property. Operating system name.
+ * The {@code os.name} System Property. Operating system name.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -742,11 +742,11 @@ public class SystemUtils {
/**
*
- * The os.version
System Property. Operating system version.
+ * The {@code os.version} System Property. Operating system version.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -761,11 +761,11 @@ public class SystemUtils {
/**
*
- * The path.separator
System Property. Path separator (":"
on UNIX).
+ * The {@code path.separator} System Property. Path separator (":"
on UNIX).
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -780,12 +780,12 @@ public class SystemUtils {
/**
*
- * The user.country
or user.region
System Property. User's country code, such as GB
. First in
- * Java version 1.2 as user.region
. Renamed to user.country
in 1.4
+ * The {@code user.country} or {@code user.region} System Property. User's country code, such as {@code GB}. First in
+ * Java version 1.2 as {@code user.region}. Renamed to {@code user.country} in 1.4
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -802,11 +802,11 @@ public class SystemUtils {
/**
*
- * The user.dir
System Property. User's current working directory.
+ * The {@code user.dir} System Property. User's current working directory.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -821,11 +821,11 @@ public class SystemUtils {
/**
*
- * The user.home
System Property. User's home directory.
+ * The {@code user.home} System Property. User's home directory.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -840,11 +840,11 @@ public class SystemUtils {
/**
*
- * The user.language
System Property. User's language code, such as "en"
.
+ * The {@code user.language} System Property. User's language code, such as {@code "en"}.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -860,11 +860,11 @@ public class SystemUtils {
/**
*
- * The user.name
System Property. User's account name.
+ * The {@code user.name} System Property. User's account name.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -879,11 +879,11 @@ public class SystemUtils {
/**
*
- * The user.timezone
System Property. For example: "America/Los_Angeles"
.
+ * The {@code user.timezone} System Property. For example: {@code "America/Los_Angeles"}.
*
*
*
- * Defaults to null
if the runtime does not have security access to read this property or the property does not exist.
+ * Defaults to {@code null} if the runtime does not have security access to read this property or the property does not exist.
*
*
*
@@ -903,77 +903,77 @@ public class SystemUtils {
/**
*
- * Is true
if this is Java version 1.1 (also 1.1.x versions).
+ * Is {@code true} if this is Java version 1.1 (also 1.1.x versions).
*
*
*
- * The field will return false
if {@link #JAVA_VERSION} is null
.
+ * The field will return {@code false} if {@link #JAVA_VERSION} is {@code null}.
*
*/
public static final boolean IS_JAVA_1_1 = getJavaVersionMatches("1.1");
/**
*
- * Is true
if this is Java version 1.2 (also 1.2.x versions).
+ * Is {@code true} if this is Java version 1.2 (also 1.2.x versions).
*
*
*
- * The field will return false
if {@link #JAVA_VERSION} is null
.
+ * The field will return {@code false} if {@link #JAVA_VERSION} is {@code null}.
*
*/
public static final boolean IS_JAVA_1_2 = getJavaVersionMatches("1.2");
/**
*
- * Is true
if this is Java version 1.3 (also 1.3.x versions).
+ * Is {@code true} if this is Java version 1.3 (also 1.3.x versions).
*
*
*
- * The field will return false
if {@link #JAVA_VERSION} is null
.
+ * The field will return {@code false} if {@link #JAVA_VERSION} is {@code null}.
*
*/
public static final boolean IS_JAVA_1_3 = getJavaVersionMatches("1.3");
/**
*
- * Is true
if this is Java version 1.4 (also 1.4.x versions).
+ * Is {@code true} if this is Java version 1.4 (also 1.4.x versions).
*
*
*
- * The field will return false
if {@link #JAVA_VERSION} is null
.
+ * The field will return {@code false} if {@link #JAVA_VERSION} is {@code null}.
*
*/
public static final boolean IS_JAVA_1_4 = getJavaVersionMatches("1.4");
/**
*
- * Is true
if this is Java version 1.5 (also 1.5.x versions).
+ * Is {@code true} if this is Java version 1.5 (also 1.5.x versions).
*
*
*
- * The field will return false
if {@link #JAVA_VERSION} is null
.
+ * The field will return {@code false} if {@link #JAVA_VERSION} is {@code null}.
*
*/
public static final boolean IS_JAVA_1_5 = getJavaVersionMatches("1.5");
/**
*
- * Is true
if this is Java version 1.6 (also 1.6.x versions).
+ * Is {@code true} if this is Java version 1.6 (also 1.6.x versions).
*
*
*
- * The field will return false
if {@link #JAVA_VERSION} is null
.
+ * The field will return {@code false} if {@link #JAVA_VERSION} is {@code null}.
*
*/
public static final boolean IS_JAVA_1_6 = getJavaVersionMatches("1.6");
/**
*
- * Is true
if this is Java version 1.7 (also 1.7.x versions).
+ * Is {@code true} if this is Java version 1.7 (also 1.7.x versions).
*
*
*
- * The field will return false
if {@link #JAVA_VERSION} is null
.
+ * The field will return {@code false} if {@link #JAVA_VERSION} is {@code null}.
*
*
* @since 3.0
@@ -990,11 +990,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is AIX.
+ * Is {@code true} if this is AIX.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1003,11 +1003,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is HP-UX.
+ * Is {@code true} if this is HP-UX.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1016,11 +1016,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is Irix.
+ * Is {@code true} if this is Irix.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1029,11 +1029,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is Linux.
+ * Is {@code true} if this is Linux.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1042,11 +1042,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is Mac.
+ * Is {@code true} if this is Mac.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1055,11 +1055,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is Mac.
+ * Is {@code true} if this is Mac.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1068,11 +1068,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is OS/2.
+ * Is {@code true} if this is OS/2.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1081,11 +1081,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is Solaris.
+ * Is {@code true} if this is Solaris.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1094,11 +1094,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is SunOS.
+ * Is {@code true} if this is SunOS.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1107,11 +1107,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is a UNIX like system, as in any of AIX, HP-UX, Irix, Linux, MacOSX, Solaris or SUN OS.
+ * Is {@code true} if this is a UNIX like system, as in any of AIX, HP-UX, Irix, Linux, MacOSX, Solaris or SUN OS.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.1
@@ -1121,11 +1121,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is Windows.
+ * Is {@code true} if this is Windows.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1134,11 +1134,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is Windows 2000.
+ * Is {@code true} if this is Windows 2000.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1147,11 +1147,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is Windows 95.
+ * Is {@code true} if this is Windows 95.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1161,11 +1161,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is Windows 98.
+ * Is {@code true} if this is Windows 98.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1175,11 +1175,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is Windows ME.
+ * Is {@code true} if this is Windows ME.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1189,11 +1189,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is Windows NT.
+ * Is {@code true} if this is Windows NT.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1203,11 +1203,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is Windows XP.
+ * Is {@code true} if this is Windows XP.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.0
@@ -1217,11 +1217,11 @@ public class SystemUtils {
// -----------------------------------------------------------------------
/**
*
- * Is true
if this is Windows Vista.
+ * Is {@code true} if this is Windows Vista.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 2.4
@@ -1230,11 +1230,11 @@ public class SystemUtils {
/**
*
- * Is true
if this is Windows 7.
+ * Is {@code true} if this is Windows 7.
*
*
*
- * The field will return false
if OS_NAME
is null
.
+ * The field will return {@code false} if {@code OS_NAME} is {@code null}.
*
*
* @since 3.0
@@ -1243,12 +1243,12 @@ public class SystemUtils {
/**
*
- * Gets the Java home directory as a File
.
+ * Gets the Java home directory as a {@code File}.
*
*
* @return a directory
* @throws SecurityException
- * if a security manager exists and its checkPropertyAccess
method doesn't allow access to the specified system
+ * if a security manager exists and its {@code checkPropertyAccess} method doesn't allow access to the specified system
* property.
* @see System#getProperty(String)
* @since 2.1
@@ -1259,12 +1259,12 @@ public static File getJavaHome() {
/**
*
- * Gets the Java IO temporary directory as a File
.
+ * Gets the Java IO temporary directory as a {@code File}.
*
*
* @return a directory
* @throws SecurityException
- * if a security manager exists and its checkPropertyAccess
method doesn't allow access to the specified system
+ * if a security manager exists and its {@code checkPropertyAccess} method doesn't allow access to the specified system
* property.
* @see System#getProperty(String)
* @since 2.1
@@ -1313,17 +1313,17 @@ private static boolean getOSMatchesName(String osNamePrefix) {
// -----------------------------------------------------------------------
/**
*
- * Gets a System property, defaulting to null
if the property cannot be read.
+ * Gets a System property, defaulting to {@code null} if the property cannot be read.
*
*
*
- * If a SecurityException
is caught, the return value is null
and a message is written to
- * System.err
.
+ * If a {@code SecurityException} is caught, the return value is {@code null} and a message is written to
+ * {@code System.err}.
*
*
* @param property
* the system property name
- * @return the system property value or null
if a security problem occurs
+ * @return the system property value or {@code null} if a security problem occurs
*/
private static String getSystemProperty(String property) {
try {
@@ -1338,12 +1338,12 @@ private static String getSystemProperty(String property) {
/**
*
- * Gets the user directory as a File
.
+ * Gets the user directory as a {@code File}.
*
*
* @return a directory
* @throws SecurityException
- * if a security manager exists and its checkPropertyAccess
method doesn't allow access to the specified system
+ * if a security manager exists and its {@code checkPropertyAccess} method doesn't allow access to the specified system
* property.
* @see System#getProperty(String)
* @since 2.1
@@ -1354,12 +1354,12 @@ public static File getUserDir() {
/**
*
- * Gets the user home directory as a File
.
+ * Gets the user home directory as a {@code File}.
*
*
* @return a directory
* @throws SecurityException
- * if a security manager exists and its checkPropertyAccess
method doesn't allow access to the specified system
+ * if a security manager exists and its {@code checkPropertyAccess} method doesn't allow access to the specified system
* property.
* @see System#getProperty(String)
* @since 2.1
@@ -1369,9 +1369,9 @@ public static File getUserHome() {
}
/**
- * Returns whether the {@link #JAVA_AWT_HEADLESS} value is true
.
+ * Returns whether the {@link #JAVA_AWT_HEADLESS} value is {@code true}.
*
- * @return true
if JAVA_AWT_HEADLESS
is "true"
, false
otherwise.
+ * @return {@code true} if {@code JAVA_AWT_HEADLESS} is {@code "true"}, {@code false} otherwise.
*
* @see #JAVA_AWT_HEADLESS
* @since 2.1
@@ -1390,13 +1390,13 @@ public static boolean isJavaAwtHeadless() {
* Example input:
*
*
- * 1.2f
to test for Java 1.2
- * 1.31f
to test for Java 1.3.1
+ * - {@code 1.2f} to test for Java 1.2
+ * - {@code 1.31f} to test for Java 1.3.1
*
*
* @param requiredVersion
* the required version, for example 1.31f
- * @return true
if the actual version is equal or greater than the required version
+ * @return {@code true} if the actual version is equal or greater than the required version
*/
public static boolean isJavaVersionAtLeast(JavaVersion requiredVersion) {
return JAVA_SPECIFICATION_VERSION_AS_ENUM.atLeast(requiredVersion);
@@ -1469,7 +1469,7 @@ static boolean isOSNameMatch(String osName, String osNamePrefix) {
/**
*
* SystemUtils instances should NOT be constructed in standard programming. Instead, the class should be used as
- * SystemUtils.FILE_SEPARATOR
.
+ * {@code SystemUtils.FILE_SEPARATOR}.
*
*
*
diff --git a/src/main/java/org/apache/commons/lang3/Validate.java b/src/main/java/org/apache/commons/lang3/Validate.java
index 26a11eca4..f546a74dd 100644
--- a/src/main/java/org/apache/commons/lang3/Validate.java
+++ b/src/main/java/org/apache/commons/lang3/Validate.java
@@ -25,8 +25,8 @@
*
This class assists in validating arguments. The validation methods are
* based along the following principles:
*
- * - An invalid
null
argument causes a {@link NullPointerException}.
- * - A non-
null
argument causes an {@link IllegalArgumentException}.
+ * - An invalid {@code null} argument causes a {@link NullPointerException}.
+ * - A non-{@code null} argument causes an {@link IllegalArgumentException}.
* - An invalid index into an array/collection/map/string causes an {@link IndexOutOfBoundsException}.
*
*
@@ -80,7 +80,7 @@ public Validate() {
//---------------------------------------------------------------------------------
/**
- * Validate that the argument condition is true
; otherwise
+ *
Validate that the argument condition is {@code true}; otherwise
* throwing an exception with the specified message. This method is useful when
* validating according to an arbitrary boolean expression, such as validating a
* primitive number or using your own custom validation expression.
@@ -93,7 +93,7 @@ public Validate() {
* @param expression the boolean expression to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param value the value to append to the message when invalid
- * @throws IllegalArgumentException if expression is false
+ * @throws IllegalArgumentException if expression is {@code false}
* @see #isTrue(boolean)
* @see #isTrue(boolean, String, double)
* @see #isTrue(boolean, String, Object...)
@@ -105,7 +105,7 @@ public static void isTrue(boolean expression, String message, long value) {
}
/**
- * Validate that the argument condition is true
; otherwise
+ *
Validate that the argument condition is {@code true}; otherwise
* throwing an exception with the specified message. This method is useful when
* validating according to an arbitrary boolean expression, such as validating a
* primitive number or using your own custom validation expression.
@@ -118,7 +118,7 @@ public static void isTrue(boolean expression, String message, long value) {
* @param expression the boolean expression to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param value the value to append to the message when invalid
- * @throws IllegalArgumentException if expression is false
+ * @throws IllegalArgumentException if expression is {@code false}
* @see #isTrue(boolean)
* @see #isTrue(boolean, String, long)
* @see #isTrue(boolean, String, Object...)
@@ -130,7 +130,7 @@ public static void isTrue(boolean expression, String message, double value) {
}
/**
- * Validate that the argument condition is true
; otherwise
+ *
Validate that the argument condition is {@code true}; otherwise
* throwing an exception with the specified message. This method is useful when
* validating according to an arbitrary boolean expression, such as validating a
* primitive number or using your own custom validation expression.
@@ -142,7 +142,7 @@ public static void isTrue(boolean expression, String message, double value) {
* @param expression the boolean expression to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
- * @throws IllegalArgumentException if expression is false
+ * @throws IllegalArgumentException if expression is {@code false}
* @see #isTrue(boolean)
* @see #isTrue(boolean, String, long)
* @see #isTrue(boolean, String, double)
@@ -154,7 +154,7 @@ public static void isTrue(boolean expression, String message, Object... values)
}
/**
- * Validate that the argument condition is true
; otherwise
+ *
Validate that the argument condition is {@code true}; otherwise
* throwing an exception. This method is useful when validating according
* to an arbitrary boolean expression, such as validating a
* primitive number or using your own custom validation expression.
@@ -167,7 +167,7 @@ public static void isTrue(boolean expression, String message, Object... values)
* false".
*
* @param expression the boolean expression to check
- * @throws IllegalArgumentException if expression is false
+ * @throws IllegalArgumentException if expression is {@code false}
* @see #isTrue(boolean, String, long)
* @see #isTrue(boolean, String, double)
* @see #isTrue(boolean, String, Object...)
@@ -182,7 +182,7 @@ public static void isTrue(boolean expression) {
//---------------------------------------------------------------------------------
/**
- * Validate that the specified argument is not null
;
+ *
Validate that the specified argument is not {@code null};
* otherwise throwing an exception.
*
*
Validate.notNull(myObject, "The object must not be null");
@@ -192,8 +192,8 @@ public static void isTrue(boolean expression) {
*
* @param the object type
* @param object the object to check
- * @return the validated object (never null
for method chaining)
- * @throws NullPointerException if the object is null
+ * @return the validated object (never {@code null} for method chaining)
+ * @throws NullPointerException if the object is {@code null}
* @see #notNull(Object, String, Object...)
*/
public static T notNull(T object) {
@@ -201,7 +201,7 @@ public static T notNull(T object) {
}
/**
- * Validate that the specified argument is not null
;
+ *
Validate that the specified argument is not {@code null};
* otherwise throwing an exception with the specified message.
*
*
Validate.notNull(myObject, "The object must not be null");
@@ -210,8 +210,8 @@ public static T notNull(T object) {
* @param object the object to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message
- * @return the validated object (never null
for method chaining)
- * @throws NullPointerException if the object is null
+ * @return the validated object (never {@code null} for method chaining)
+ * @throws NullPointerException if the object is {@code null}
* @see #notNull(Object)
*/
public static T notNull(T object, String message, Object... values) {
@@ -225,7 +225,7 @@ public static T notNull(T object, String message, Object... values) {
//---------------------------------------------------------------------------------
/**
- * Validate that the specified argument array is neither null
+ *
Validate that the specified argument array is neither {@code null}
* nor a length of zero (no elements); otherwise throwing an exception
* with the specified message.
*
@@ -235,8 +235,8 @@ public static T notNull(T object, String message, Object... values) {
* @param array the array to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
- * @return the validated array (never null
method for chaining)
- * @throws NullPointerException if the array is null
+ * @return the validated array (never {@code null} method for chaining)
+ * @throws NullPointerException if the array is {@code null}
* @throws IllegalArgumentException if the array is empty
* @see #notEmpty(Object[])
*/
@@ -251,7 +251,7 @@ public static T[] notEmpty(T[] array, String message, Object... values) {
}
/**
- * Validate that the specified argument array is neither null
+ *
Validate that the specified argument array is neither {@code null}
* nor a length of zero (no elements); otherwise throwing an exception.
*
*
Validate.notEmpty(myArray);
@@ -261,8 +261,8 @@ public static T[] notEmpty(T[] array, String message, Object... values) {
*
* @param the array type
* @param array the array to check, validated not null by this method
- * @return the validated array (never null
method for chaining)
- * @throws NullPointerException if the array is null
+ * @return the validated array (never {@code null} method for chaining)
+ * @throws NullPointerException if the array is {@code null}
* @throws IllegalArgumentException if the array is empty
* @see #notEmpty(Object[], String, Object...)
*/
@@ -274,7 +274,7 @@ public static T[] notEmpty(T[] array) {
//---------------------------------------------------------------------------------
/**
- * Validate that the specified argument collection is neither null
+ *
Validate that the specified argument collection is neither {@code null}
* nor a size of zero (no elements); otherwise throwing an exception
* with the specified message.
*
@@ -284,8 +284,8 @@ public static T[] notEmpty(T[] array) {
* @param collection the collection to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
- * @return the validated collection (never null
method for chaining)
- * @throws NullPointerException if the collection is null
+ * @return the validated collection (never {@code null} method for chaining)
+ * @throws NullPointerException if the collection is {@code null}
* @throws IllegalArgumentException if the collection is empty
* @see #notEmpty(Object[])
*/
@@ -300,7 +300,7 @@ public static > T notEmpty(T collection, String message,
}
/**
- * Validate that the specified argument collection is neither null
+ *
Validate that the specified argument collection is neither {@code null}
* nor a size of zero (no elements); otherwise throwing an exception.
*
*
Validate.notEmpty(myCollection);
@@ -310,8 +310,8 @@ public static > T notEmpty(T collection, String message,
*
* @param the collection type
* @param collection the collection to check, validated not null by this method
- * @return the validated collection (never null
method for chaining)
- * @throws NullPointerException if the collection is null
+ * @return the validated collection (never {@code null} method for chaining)
+ * @throws NullPointerException if the collection is {@code null}
* @throws IllegalArgumentException if the collection is empty
* @see #notEmpty(Collection, String, Object...)
*/
@@ -323,7 +323,7 @@ public static > T notEmpty(T collection) {
//---------------------------------------------------------------------------------
/**
- * Validate that the specified argument map is neither null
+ *
Validate that the specified argument map is neither {@code null}
* nor a size of zero (no elements); otherwise throwing an exception
* with the specified message.
*
@@ -333,8 +333,8 @@ public static > T notEmpty(T collection) {
* @param map the map to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
- * @return the validated map (never null
method for chaining)
- * @throws NullPointerException if the map is null
+ * @return the validated map (never {@code null} method for chaining)
+ * @throws NullPointerException if the map is {@code null}
* @throws IllegalArgumentException if the map is empty
* @see #notEmpty(Object[])
*/
@@ -349,7 +349,7 @@ public static > T notEmpty(T collection) {
}
/**
- * Validate that the specified argument map is neither null
+ *
Validate that the specified argument map is neither {@code null}
* nor a size of zero (no elements); otherwise throwing an exception.
*
*
Validate.notEmpty(myMap);
@@ -359,8 +359,8 @@ public static > T notEmpty(T collection) {
*
* @param the map type
* @param map the map to check, validated not null by this method
- * @return the validated map (never null
method for chaining)
- * @throws NullPointerException if the map is null
+ * @return the validated map (never {@code null} method for chaining)
+ * @throws NullPointerException if the map is {@code null}
* @throws IllegalArgumentException if the map is empty
* @see #notEmpty(Map, String, Object...)
*/
@@ -373,7 +373,7 @@ public static > T notEmpty(T collection) {
/**
* Validate that the specified argument character sequence is
- * neither null
nor a length of zero (no characters);
+ * neither {@code null} nor a length of zero (no characters);
* otherwise throwing an exception with the specified message.
*
*
Validate.notEmpty(myString, "The string must not be empty");
@@ -382,8 +382,8 @@ public static > T notEmpty(T collection) {
* @param chars the character sequence to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
- * @return the validated character sequence (never null
method for chaining)
- * @throws NullPointerException if the character sequence is null
+ * @return the validated character sequence (never {@code null} method for chaining)
+ * @throws NullPointerException if the character sequence is {@code null}
* @throws IllegalArgumentException if the character sequence is empty
* @see #notEmpty(CharSequence)
*/
@@ -399,7 +399,7 @@ public static T notEmpty(T chars, String message, Objec
/**
* Validate that the specified argument character sequence is
- * neither null
nor a length of zero (no characters);
+ * neither {@code null} nor a length of zero (no characters);
* otherwise throwing an exception with the specified message.
*
*
Validate.notEmpty(myString);
@@ -409,8 +409,8 @@ public static T notEmpty(T chars, String message, Objec
*
* @param the character sequence type
* @param chars the character sequence to check, validated not null by this method
- * @return the validated character sequence (never null
method for chaining)
- * @throws NullPointerException if the character sequence is null
+ * @return the validated character sequence (never {@code null} method for chaining)
+ * @throws NullPointerException if the character sequence is {@code null}
* @throws IllegalArgumentException if the character sequence is empty
* @see #notEmpty(CharSequence, String, Object...)
*/
@@ -423,7 +423,7 @@ public static T notEmpty(T chars) {
/**
* Validate that the specified argument character sequence is
- * neither null
, a length of zero (no characters), empty
+ * neither {@code null}, a length of zero (no characters), empty
* nor whitespace; otherwise throwing an exception with the specified
* message.
*
@@ -433,8 +433,8 @@ public static T notEmpty(T chars) {
* @param chars the character sequence to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
- * @return the validated character sequence (never null
method for chaining)
- * @throws NullPointerException if the character sequence is null
+ * @return the validated character sequence (never {@code null} method for chaining)
+ * @throws NullPointerException if the character sequence is {@code null}
* @throws IllegalArgumentException if the character sequence is blank
* @see #notBlank(CharSequence)
*/
@@ -450,7 +450,7 @@ public static T notBlank(T chars, String message, Objec
/**
* Validate that the specified argument character sequence is
- * neither null
, a length of zero (no characters), empty
+ * neither {@code null}, a length of zero (no characters), empty
* nor whitespace; otherwise throwing an exception.
*
*
Validate.notBlank(myString);
@@ -460,8 +460,8 @@ public static T notBlank(T chars, String message, Objec
*
* @param the character sequence type
* @param chars the character sequence to check, validated not null by this method
- * @return the validated character sequence (never null
method for chaining)
- * @throws NullPointerException if the character sequence is null
+ * @return the validated character sequence (never {@code null} method for chaining)
+ * @throws NullPointerException if the character sequence is {@code null}
* @throws IllegalArgumentException if the character sequence is blank
* @see #notBlank(CharSequence, String, Object...)
*/
@@ -474,25 +474,25 @@ public static T notBlank(T chars) {
/**
* Validate that the specified argument array is neither
- * null
nor contains any elements that are null
;
+ * {@code null} nor contains any elements that are {@code null};
* otherwise throwing an exception with the specified message.
*
*
Validate.noNullElements(myArray, "The array contain null at position %d");
*
- * If the array is null
, then the message in the exception
+ *
If the array is {@code null}, then the message in the exception
* is "The validated object is null".
*
- * If the array has a null
element, then the iteration
- * index of the invalid element is appended to the values
+ *
If the array has a {@code null} element, then the iteration
+ * index of the invalid element is appended to the {@code values}
* argument.
*
* @param the array type
* @param array the array to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
- * @return the validated array (never null
method for chaining)
- * @throws NullPointerException if the array is null
- * @throws IllegalArgumentException if an element is null
+ * @return the validated array (never {@code null} method for chaining)
+ * @throws NullPointerException if the array is {@code null}
+ * @throws IllegalArgumentException if an element is {@code null}
* @see #noNullElements(Object[])
*/
public static T[] noNullElements(T[] array, String message, Object... values) {
@@ -508,23 +508,23 @@ public static T[] noNullElements(T[] array, String message, Object... values
/**
* Validate that the specified argument array is neither
- * null
nor contains any elements that are null
;
+ * {@code null} nor contains any elements that are {@code null};
* otherwise throwing an exception.
*
*
Validate.noNullElements(myArray);
*
- * If the array is null
, then the message in the exception
+ *
If the array is {@code null}, then the message in the exception
* is "The validated object is null".
*
- * If the array has a null
element, then the message in the
+ *
If the array has a {@code null} element, then the message in the
* exception is "The validated array contains null element at index:
* " followed by the index.
*
* @param the array type
* @param array the array to check, validated not null by this method
- * @return the validated array (never null
method for chaining)
- * @throws NullPointerException if the array is null
- * @throws IllegalArgumentException if an element is null
+ * @return the validated array (never {@code null} method for chaining)
+ * @throws NullPointerException if the array is {@code null}
+ * @throws IllegalArgumentException if an element is {@code null}
* @see #noNullElements(Object[], String, Object...)
*/
public static T[] noNullElements(T[] array) {
@@ -536,25 +536,25 @@ public static T[] noNullElements(T[] array) {
/**
* Validate that the specified argument iterable is neither
- * null
nor contains any elements that are null
;
+ * {@code null} nor contains any elements that are {@code null};
* otherwise throwing an exception with the specified message.
*
*
Validate.noNullElements(myCollection, "The collection contains null at position %d");
*
- * If the iterable is null
, then the message in the exception
+ *
If the iterable is {@code null}, then the message in the exception
* is "The validated object is null".
*
- * If the iterable has a null
element, then the iteration
- * index of the invalid element is appended to the values
+ *
If the iterable has a {@code null} element, then the iteration
+ * index of the invalid element is appended to the {@code values}
* argument.
*
* @param the iterable type
* @param iterable the iterable to check, validated not null by this method
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
- * @return the validated iterable (never null
method for chaining)
- * @throws NullPointerException if the array is null
- * @throws IllegalArgumentException if an element is null
+ * @return the validated iterable (never {@code null} method for chaining)
+ * @throws NullPointerException if the array is {@code null}
+ * @throws IllegalArgumentException if an element is {@code null}
* @see #noNullElements(Iterable)
*/
public static > T noNullElements(T iterable, String message, Object... values) {
@@ -571,23 +571,23 @@ public static > T noNullElements(T iterable, String messag
/**
* Validate that the specified argument iterable is neither
- * null
nor contains any elements that are null
;
+ * {@code null} nor contains any elements that are {@code null};
* otherwise throwing an exception.
*
*
Validate.noNullElements(myCollection);
*
- * If the iterable is null
, then the message in the exception
+ *
If the iterable is {@code null}, then the message in the exception
* is "The validated object is null".
*
- * If the array has a null
element, then the message in the
+ *
If the array has a {@code null} element, then the message in the
* exception is "The validated iterable contains null element at index:
* " followed by the index.
*
* @param the iterable type
* @param iterable the iterable to check, validated not null by this method
- * @return the validated iterable (never null
method for chaining)
- * @throws NullPointerException if the array is null
- * @throws IllegalArgumentException if an element is null
+ * @return the validated iterable (never {@code null} method for chaining)
+ * @throws NullPointerException if the array is {@code null}
+ * @throws IllegalArgumentException if an element is {@code null}
* @see #noNullElements(Iterable, String, Object...)
*/
public static > T noNullElements(T iterable) {
@@ -603,7 +603,7 @@ public static > T noNullElements(T iterable) {
*
* Validate.validIndex(myArray, 2, "The array index is invalid: ");
*
- * If the array is null
, then the message of the exception
+ *
If the array is {@code null}, then the message of the exception
* is "The validated object is null".
*
* @param the array type
@@ -611,8 +611,8 @@ public static > T noNullElements(T iterable) {
* @param index the index to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
- * @return the validated array (never null
for method chaining)
- * @throws NullPointerException if the array is null
+ * @return the validated array (never {@code null} for method chaining)
+ * @throws NullPointerException if the array is {@code null}
* @throws IndexOutOfBoundsException if the index is invalid
* @see #validIndex(Object[], int)
*/
@@ -630,7 +630,7 @@ public static T[] validIndex(T[] array, int index, String message, Object...
*
* Validate.validIndex(myArray, 2);
*
- * If the array is null
, then the message of the exception
+ *
If the array is {@code null}, then the message of the exception
* is "The validated object is null".
*
* If the index is invalid, then the message of the exception is
@@ -640,8 +640,8 @@ public static T[] validIndex(T[] array, int index, String message, Object...
* @param the array type
* @param array the array to check, validated not null by this method
* @param index the index to check
- * @return the validated array (never null
for method chaining)
- * @throws NullPointerException if the array is null
+ * @return the validated array (never {@code null} for method chaining)
+ * @throws NullPointerException if the array is {@code null}
* @throws IndexOutOfBoundsException if the index is invalid
* @see #validIndex(Object[], int, String, Object...)
*/
@@ -658,7 +658,7 @@ public static T[] validIndex(T[] array, int index) {
*
* Validate.validIndex(myCollection, 2, "The collection index is invalid: ");
*
- * If the collection is null
, then the message of the
+ *
If the collection is {@code null}, then the message of the
* exception is "The validated object is null".
*
* @param the collection type
@@ -666,8 +666,8 @@ public static T[] validIndex(T[] array, int index) {
* @param index the index to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
- * @return the validated collection (never null
for chaining)
- * @throws NullPointerException if the collection is null
+ * @return the validated collection (never {@code null} for chaining)
+ * @throws NullPointerException if the collection is {@code null}
* @throws IndexOutOfBoundsException if the index is invalid
* @see #validIndex(Collection, int)
*/
@@ -692,8 +692,8 @@ public static > T validIndex(T collection, int index, St
* @param the collection type
* @param collection the collection to check, validated not null by this method
* @param index the index to check
- * @return the validated collection (never null
for method chaining)
- * @throws NullPointerException if the collection is null
+ * @return the validated collection (never {@code null} for method chaining)
+ * @throws NullPointerException if the collection is {@code null}
* @throws IndexOutOfBoundsException if the index is invalid
* @see #validIndex(Collection, int, String, Object...)
*/
@@ -711,7 +711,7 @@ public static > T validIndex(T collection, int index) {
*
* Validate.validIndex(myStr, 2, "The string index is invalid: ");
*
- * If the character sequence is null
, then the message
+ *
If the character sequence is {@code null}, then the message
* of the exception is "The validated object is null".
*
* @param the character sequence type
@@ -719,8 +719,8 @@ public static > T validIndex(T collection, int index) {
* @param index the index to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
- * @return the validated character sequence (never null
for method chaining)
- * @throws NullPointerException if the character sequence is null
+ * @return the validated character sequence (never {@code null} for method chaining)
+ * @throws NullPointerException if the character sequence is {@code null}
* @throws IndexOutOfBoundsException if the index is invalid
* @see #validIndex(CharSequence, int)
*/
@@ -738,7 +738,7 @@ public static T validIndex(T chars, int index, String m
*
* Validate.validIndex(myStr, 2);
*
- * If the character sequence is null
, then the message
+ *
If the character sequence is {@code null}, then the message
* of the exception is "The validated object is
* null".
*
@@ -749,8 +749,8 @@ public static T validIndex(T chars, int index, String m
* @param the character sequence type
* @param chars the character sequence to check, validated not null by this method
* @param index the index to check
- * @return the validated character sequence (never null
for method chaining)
- * @throws NullPointerException if the character sequence is null
+ * @return the validated character sequence (never {@code null} for method chaining)
+ * @throws NullPointerException if the character sequence is {@code null}
* @throws IndexOutOfBoundsException if the index is invalid
* @see #validIndex(CharSequence, int, String, Object...)
*/
@@ -762,7 +762,7 @@ public static T validIndex(T chars, int index) {
//---------------------------------------------------------------------------------
/**
- * Validate that the stateful condition is true
; otherwise
+ *
Validate that the stateful condition is {@code true}; otherwise
* throwing an exception. This method is useful when validating according
* to an arbitrary boolean expression, such as validating a
* primitive number or using your own custom validation expression.
@@ -775,7 +775,7 @@ public static T validIndex(T chars, int index) {
* false".
*
* @param expression the boolean expression to check
- * @throws IllegalStateException if expression is false
+ * @throws IllegalStateException if expression is {@code false}
* @see #validState(boolean, String, Object...)
*/
public static void validState(boolean expression) {
@@ -785,7 +785,7 @@ public static void validState(boolean expression) {
}
/**
- * Validate that the stateful condition is true
; otherwise
+ *
Validate that the stateful condition is {@code true}; otherwise
* throwing an exception with the specified message. This method is useful when
* validating according to an arbitrary boolean expression, such as validating a
* primitive number or using your own custom validation expression.
@@ -795,7 +795,7 @@ public static void validState(boolean expression) {
* @param expression the boolean expression to check
* @param message the {@link String#format(String, Object...)} exception message if invalid, not null
* @param values the optional values for the formatted exception message, null array not recommended
- * @throws IllegalStateException if expression is false
+ * @throws IllegalStateException if expression is {@code false}
* @see #validState(boolean)
*/
public static void validState(boolean expression, String message, Object... values) {
diff --git a/src/main/java/org/apache/commons/lang3/builder/Builder.java b/src/main/java/org/apache/commons/lang3/builder/Builder.java
index f11e0f1e4..f5272399f 100644
--- a/src/main/java/org/apache/commons/lang3/builder/Builder.java
+++ b/src/main/java/org/apache/commons/lang3/builder/Builder.java
@@ -32,7 +32,7 @@
*
*
* It is a recommended practice that the methods supplied to configure the
- * object or result being built return a reference to this
so that
+ * object or result being built return a reference to {@code this} so that
* method calls can be chained together.
*
*