Author: scolebourne
Date: Fri Mar 4 15:37:12 2011
New Revision: 1078013
URL: http://svn.apache.org/viewvc?rev=1078013&view=rev
Log:
Javadoc
Modified:
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/BooleanUtils.java
Modified:
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/BooleanUtils.java
URL:
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/BooleanUtils.java?rev=1078013&r1=1078012&r2=1078013&view=diff
==============================================================================
---
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/BooleanUtils.java
(original)
+++
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/BooleanUtils.java
Fri Mar 4 15:37:12 2011
@@ -21,8 +21,8 @@ import org.apache.commons.lang3.math.Num
/**
* <p>Operations on boolean primitives and Boolean objects.</p>
*
- * <p>This class tries to handle <code>null</code> input gracefully.
- * An exception will not be thrown for a <code>null</code> input.
+ * <p>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.</p>
*
* <p>#ThreadSafe#</p>
@@ -35,8 +35,8 @@ import org.apache.commons.lang3.math.Num
public class BooleanUtils {
/**
- * <p><code>BooleanUtils</code> instances should NOT be constructed in
standard programming.
- * Instead, the class should be used as
<code>BooleanUtils.negate(true);</code>.</p>
+ * <p>{@code BooleanUtils} instances should NOT be constructed in standard
programming.
+ * Instead, the class should be used as {@code
BooleanUtils.negate(true);}.</p>
*
* <p>This constructor is public to permit tools that require a JavaBean
instance
* to operate.</p>
@@ -50,7 +50,7 @@ public class BooleanUtils {
/**
* <p>Negates the specified boolean.</p>
*
- * <p>If <code>null</code> is passed in, <code>null</code> will be
returned.</p>
+ * <p>If {@code null} is passed in, {@code null} will be returned.</p>
*
* <p>NOTE: This returns null and will throw a NullPointerException if
autoboxed to a boolean. </p>
*
@@ -61,7 +61,7 @@ public class BooleanUtils {
* </pre>
*
* @param bool the Boolean to negate, may be null
- * @return the negated Boolean, or <code>null</code> if <code>null</code>
input
+ * @return the negated Boolean, or {@code null} if {@code null} input
*/
public static Boolean negate(Boolean bool) {
if (bool == null) {
@@ -73,8 +73,8 @@ public class BooleanUtils {
// boolean Boolean methods
//-----------------------------------------------------------------------
/**
- * <p>Checks if a <code>Boolean</code> value is <code>true</code>,
- * handling <code>null</code> by returning <code>false</code>.</p>
+ * <p>Checks if a {@code Boolean} value is {@code true},
+ * handling {@code null} by returning {@code false}.</p>
*
* <pre>
* BooleanUtils.isTrue(Boolean.TRUE) = true
@@ -82,8 +82,8 @@ public class BooleanUtils {
* BooleanUtils.isTrue(null) = false
* </pre>
*
- * @param bool the boolean to check, null returns <code>false</code>
- * @return <code>true</code> only if the input is non-null and true
+ * @param bool the boolean to check, null returns {@code false}
+ * @return {@code true} only if the input is non-null and true
* @since 2.1
*/
public static boolean isTrue(Boolean bool) {
@@ -94,8 +94,8 @@ public class BooleanUtils {
}
/**
- * <p>Checks if a <code>Boolean</code> value is <i>not</i>
<code>true</code>,
- * handling <code>null</code> by returning <code>true</code>.</p>
+ * <p>Checks if a {@code Boolean} value is <i>not</i> {@code true},
+ * handling {@code null} by returning {@code true}.</p>
*
* <pre>
* BooleanUtils.isNotTrue(Boolean.TRUE) = false
@@ -103,8 +103,8 @@ public class BooleanUtils {
* BooleanUtils.isNotTrue(null) = true
* </pre>
*
- * @param bool the boolean to check, null returns <code>true</code>
- * @return <code>true</code> if the input is null or false
+ * @param bool the boolean to check, null returns {@code true}
+ * @return {@code true} if the input is null or false
* @since 2.3
*/
public static boolean isNotTrue(Boolean bool) {
@@ -112,8 +112,8 @@ public class BooleanUtils {
}
/**
- * <p>Checks if a <code>Boolean</code> value is <code>false</code>,
- * handling <code>null</code> by returning <code>false</code>.</p>
+ * <p>Checks if a {@code Boolean} value is {@code false},
+ * handling {@code null} by returning {@code false}.</p>
*
* <pre>
* BooleanUtils.isFalse(Boolean.TRUE) = false
@@ -121,8 +121,8 @@ public class BooleanUtils {
* BooleanUtils.isFalse(null) = false
* </pre>
*
- * @param bool the boolean to check, null returns <code>false</code>
- * @return <code>true</code> only if the input is non-null and false
+ * @param bool the boolean to check, null returns {@code false}
+ * @return {@code true} only if the input is non-null and false
* @since 2.1
*/
public static boolean isFalse(Boolean bool) {
@@ -133,8 +133,8 @@ public class BooleanUtils {
}
/**
- * <p>Checks if a <code>Boolean</code> value is <i>not</i>
<code>false</code>,
- * handling <code>null</code> by returning <code>true</code>.</p>
+ * <p>Checks if a {@code Boolean} value is <i>not</i> {@code false},
+ * handling {@code null} by returning {@code true}.</p>
*
* <pre>
* BooleanUtils.isNotFalse(Boolean.TRUE) = true
@@ -142,8 +142,8 @@ public class BooleanUtils {
* BooleanUtils.isNotFalse(null) = true
* </pre>
*
- * @param bool the boolean to check, null returns <code>true</code>
- * @return <code>true</code> if the input is null or true
+ * @param bool the boolean to check, null returns {@code true}
+ * @return {@code true} if the input is null or true
* @since 2.3
*/
public static boolean isNotFalse(Boolean bool) {
@@ -152,8 +152,8 @@ public class BooleanUtils {
//-----------------------------------------------------------------------
/**
- * <p>Converts a Boolean to a boolean handling <code>null</code>
- * by returning <code>false</code>.</p>
+ * <p>Converts a Boolean to a boolean handling {@code null}
+ * by returning {@code false}.</p>
*
* <pre>
* BooleanUtils.toBoolean(Boolean.TRUE) = true
@@ -162,8 +162,7 @@ public class BooleanUtils {
* </pre>
*
* @param bool the boolean to convert
- * @return <code>true</code> or <code>false</code>,
- * <code>null</code> returns <code>false</code>
+ * @return {@code true} or {@code false}, {@code null} returns {@code
false}
*/
public static boolean toBoolean(Boolean bool) {
if (bool == null) {
@@ -173,7 +172,7 @@ public class BooleanUtils {
}
/**
- * <p>Converts a Boolean to a boolean handling <code>null</code>.</p>
+ * <p>Converts a Boolean to a boolean handling {@code null}.</p>
*
* <pre>
* BooleanUtils.toBooleanDefaultIfNull(Boolean.TRUE, false) = true
@@ -182,8 +181,8 @@ public class BooleanUtils {
* </pre>
*
* @param bool the boolean to convert
- * @param valueIfNull the boolean value to return if <code>null</code>
- * @return <code>true</code> or <code>false</code>
+ * @param valueIfNull the boolean value to return if {@code null}
+ * @return {@code true} or {@code false}
*/
public static boolean toBooleanDefaultIfNull(Boolean bool, boolean
valueIfNull) {
if (bool == null) {
@@ -195,8 +194,8 @@ public class BooleanUtils {
// Integer to Boolean methods
//-----------------------------------------------------------------------
/**
- * <p>Converts an int to a boolean using the convention that
<code>zero</code>
- * is <code>false</code>.</p>
+ * <p>Converts an int to a boolean using the convention that {@code zero}
+ * is {@code false}.</p>
*
* <pre>
* BooleanUtils.toBoolean(0) = false
@@ -205,7 +204,7 @@ public class BooleanUtils {
* </pre>
*
* @param value the int to convert
- * @return <code>true</code> if non-zero, <code>false</code>
+ * @return {@code true} if non-zero, {@code false}
* if zero
*/
public static boolean toBoolean(int value) {
@@ -213,8 +212,8 @@ public class BooleanUtils {
}
/**
- * <p>Converts an int to a Boolean using the convention that
<code>zero</code>
- * is <code>false</code>.</p>
+ * <p>Converts an int to a Boolean using the convention that {@code zero}
+ * is {@code false}.</p>
*
* <pre>
* BooleanUtils.toBoolean(0) = Boolean.FALSE
@@ -224,17 +223,17 @@ public class BooleanUtils {
*
* @param value the int to convert
* @return Boolean.TRUE if non-zero, Boolean.FALSE if zero,
- * <code>null</code> if <code>null</code>
+ * {@code null} if {@code null}
*/
public static Boolean toBooleanObject(int value) {
return value == 0 ? Boolean.FALSE : Boolean.TRUE;
}
/**
- * <p>Converts an Integer to a Boolean using the convention that
<code>zero</code>
- * is <code>false</code>.</p>
+ * <p>Converts an Integer to a Boolean using the convention that {@code
zero}
+ * is {@code false}.</p>
*
- * <p><code>null</code> will be converted to <code>null</code>.</p>
+ * <p>{@code null} will be converted to {@code null}.</p>
*
* <p>NOTE: This returns null and will throw a NullPointerException if
autoboxed to a boolean. </p>
*
@@ -246,7 +245,7 @@ public class BooleanUtils {
*
* @param value the Integer to convert
* @return Boolean.TRUE if non-zero, Boolean.FALSE if zero,
- * <code>null</code> if <code>null</code> input
+ * {@code null} if {@code null} input
*/
public static Boolean toBooleanObject(Integer value) {
if (value == null) {
@@ -266,9 +265,9 @@ public class BooleanUtils {
* </pre>
*
* @param value the Integer to convert
- * @param trueValue the value to match for <code>true</code>
- * @param falseValue the value to match for <code>false</code>
- * @return <code>true</code> or <code>false</code>
+ * @param trueValue the value to match for {@code true}
+ * @param falseValue the value to match for {@code false}
+ * @return {@code true} or {@code false}
* @throws IllegalArgumentException if no match
*/
public static boolean toBoolean(int value, int trueValue, int falseValue) {
@@ -293,11 +292,9 @@ public class BooleanUtils {
* </pre>
*
* @param value the Integer to convert
- * @param trueValue the value to match for <code>true</code>,
- * may be <code>null</code>
- * @param falseValue the value to match for <code>false</code>,
- * may be <code>null</code>
- * @return <code>true</code> or <code>false</code>
+ * @param trueValue the value to match for {@code true}, may be {@code
null}
+ * @param falseValue the value to match for {@code false}, may be {@code
null}
+ * @return {@code true} or {@code false}
* @throws IllegalArgumentException if no match
*/
public static boolean toBoolean(Integer value, Integer trueValue, Integer
falseValue) {
@@ -328,10 +325,10 @@ public class BooleanUtils {
* </pre>
*
* @param value the Integer to convert
- * @param trueValue the value to match for <code>true</code>
- * @param falseValue the value to match for <code>false</code>
- * @param nullValue the value to to match for <code>null</code>
- * @return Boolean.TRUE, Boolean.FALSE, or <code>null</code>
+ * @param trueValue the value to match for {@code true}
+ * @param falseValue the value to match for {@code false}
+ * @param nullValue the value to to match for {@code null}
+ * @return Boolean.TRUE, Boolean.FALSE, or {@code null}
* @throws IllegalArgumentException if no match
*/
public static Boolean toBooleanObject(int value, int trueValue, int
falseValue, int nullValue) {
@@ -358,13 +355,10 @@ public class BooleanUtils {
* </pre>
*
* @param value the Integer to convert
- * @param trueValue the value to match for <code>true</code>,
- * may be <code>null</code>
- * @param falseValue the value to match for <code>false</code>,
- * may be <code>null</code>
- * @param nullValue the value to to match for <code>null</code>,
- * may be <code>null</code>
- * @return Boolean.TRUE, Boolean.FALSE, or <code>null</code>
+ * @param trueValue the value to match for {@code true}, may be {@code
null}
+ * @param falseValue the value to match for {@code false}, may be {@code
null}
+ * @param nullValue the value to to match for {@code null}, may be {@code
null}
+ * @return Boolean.TRUE, Boolean.FALSE, or {@code null}
* @throws IllegalArgumentException if no match
*/
public static Boolean toBooleanObject(Integer value, Integer trueValue,
Integer falseValue, Integer nullValue) {
@@ -391,7 +385,7 @@ public class BooleanUtils {
//-----------------------------------------------------------------------
/**
* <p>Converts a boolean to an int using the convention that
- * <code>zero</code> is <code>false</code>.</p>
+ * {@code zero} is {@code false}.</p>
*
* <pre>
* BooleanUtils.toInteger(true) = 1
@@ -399,7 +393,7 @@ public class BooleanUtils {
* </pre>
*
* @param bool the boolean to convert
- * @return one if <code>true</code>, zero if <code>false</code>
+ * @return one if {@code true}, zero if {@code false}
*/
public static int toInteger(boolean bool) {
return bool ? 1 : 0;
@@ -407,7 +401,7 @@ public class BooleanUtils {
/**
* <p>Converts a boolean to an Integer using the convention that
- * <code>zero</code> is <code>false</code>.</p>
+ * {@code zero} is {@code false}.</p>
*
* <pre>
* BooleanUtils.toIntegerObject(true) = new Integer(1)
@@ -415,7 +409,7 @@ public class BooleanUtils {
* </pre>
*
* @param bool the boolean to convert
- * @return one if <code>true</code>, zero if <code>false</code>
+ * @return one if {@code true}, zero if {@code false}
*/
public static Integer toIntegerObject(boolean bool) {
return bool ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO;
@@ -423,9 +417,9 @@ public class BooleanUtils {
/**
* <p>Converts a Boolean to a Integer using the convention that
- * <code>zero</code> is <code>false</code>.</p>
+ * {@code zero} is {@code false}.</p>
*
- * <p><code>null</code> will be converted to <code>null</code>.</p>
+ * <p>{@code null} will be converted to {@code null}.</p>
*
* <pre>
* BooleanUtils.toIntegerObject(Boolean.TRUE) = new Integer(1)
@@ -433,7 +427,7 @@ public class BooleanUtils {
* </pre>
*
* @param bool the Boolean to convert
- * @return one if Boolean.TRUE, zero if Boolean.FALSE, <code>null</code>
if <code>null</code>
+ * @return one if Boolean.TRUE, zero if Boolean.FALSE, {@code null} if
{@code null}
*/
public static Integer toIntegerObject(Boolean bool) {
if (bool == null) {
@@ -451,8 +445,8 @@ public class BooleanUtils {
* </pre>
*
* @param bool the to convert
- * @param trueValue the value to return if <code>true</code>
- * @param falseValue the value to return if <code>false</code>
+ * @param trueValue the value to return if {@code true}
+ * @param falseValue the value to return if {@code false}
* @return the appropriate value
*/
public static int toInteger(boolean bool, int trueValue, int falseValue) {
@@ -469,9 +463,9 @@ public class BooleanUtils {
* </pre>
*
* @param bool the Boolean to convert
- * @param trueValue the value to return if <code>true</code>
- * @param falseValue the value to return if <code>false</code>
- * @param nullValue the value to return if <code>null</code>
+ * @param trueValue the value to return if {@code true}
+ * @param falseValue the value to return if {@code false}
+ * @param nullValue the value to return if {@code null}
* @return the appropriate value
*/
public static int toInteger(Boolean bool, int trueValue, int falseValue,
int nullValue) {
@@ -490,10 +484,8 @@ public class BooleanUtils {
* </pre>
*
* @param bool the to convert
- * @param trueValue the value to return if <code>true</code>,
- * may be <code>null</code>
- * @param falseValue the value to return if <code>false</code>,
- * may be <code>null</code>
+ * @param trueValue the value to return if {@code true}, may be {@code
null}
+ * @param falseValue the value to return if {@code false}, may be {@code
null}
* @return the appropriate value
*/
public static Integer toIntegerObject(boolean bool, Integer trueValue,
Integer falseValue) {
@@ -510,12 +502,9 @@ public class BooleanUtils {
* </pre>
*
* @param bool the Boolean to convert
- * @param trueValue the value to return if <code>true</code>,
- * may be <code>null</code>
- * @param falseValue the value to return if <code>false</code>,
- * may be <code>null</code>
- * @param nullValue the value to return if <code>null</code>,
- * may be <code>null</code>
+ * @param trueValue the value to return if {@code true}, may be {@code
null}
+ * @param falseValue the value to return if {@code false}, may be {@code
null}
+ * @param nullValue the value to return if {@code null}, may be {@code
null}
* @return the appropriate value
*/
public static Integer toIntegerObject(Boolean bool, Integer trueValue,
Integer falseValue, Integer nullValue) {
@@ -530,11 +519,11 @@ public class BooleanUtils {
/**
* <p>Converts a String to a Boolean.</p>
*
- * <p><code>'true'</code>, <code>'on'</code> or <code>'yes'</code>
- * (case insensitive) will return <code>true</code>.
- * <code>'false'</code>, <code>'off'</code> or <code>'no'</code>
- * (case insensitive) will return <code>false</code>.
- * Otherwise, <code>null</code> is returned.</p>
+ * <p>{@code 'true'}, {@code 'on'} or {@code 'yes'}
+ * (case insensitive) will return {@code true}.
+ * {@code 'false'}, {@code 'off'} or {@code 'no'}
+ * (case insensitive) will return {@code false}.
+ * Otherwise, {@code null} is returned.</p>
*
* <p>NOTE: This returns null and will throw a NullPointerException if
autoboxed to a boolean. </p>
*
@@ -550,8 +539,7 @@ public class BooleanUtils {
* </pre>
*
* @param str the String to check
- * @return the Boolean value of the string,
- * <code>null</code> if no match or <code>null</code> input
+ * @return the Boolean value of the string, {@code null} if no match or
{@code null} input
*/
public static Boolean toBooleanObject(String str) {
// Previously used equalsIgnoreCase, which was fast for interned
'true'.
@@ -653,16 +641,11 @@ public class BooleanUtils {
* </pre>
*
* @param str the String to check
- * @param trueString the String to match for <code>true</code>
- * (case sensitive), may be <code>null</code>
- * @param falseString the String to match for <code>false</code>
- * (case sensitive), may be <code>null</code>
- * @param nullString the String to match for <code>null</code>
- * (case sensitive), may be <code>null</code>
- * @return the Boolean value of the string,
- * <code>null</code> if either the String matches <code>nullString</code>
- * or if <code>null</code> input and <code>nullString</code> is
- * <code>null</code>
+ * @param trueString the String to match for {@code true} (case
sensitive), may be {@code null}
+ * @param falseString the String to match for {@code false} (case
sensitive), may be {@code null}
+ * @param nullString the String to match for {@code null} (case
sensitive), may be {@code null}
+ * @return the Boolean value of the string, {@code null} if either the
String matches {@code nullString}
+ * or if {@code null} input and {@code nullString} is {@code null}
* @throws IllegalArgumentException if the String doesn't match
*/
public static Boolean toBooleanObject(String str, String trueString,
String falseString, String nullString) {
@@ -690,12 +673,12 @@ public class BooleanUtils {
/**
* <p>Converts a String to a boolean (optimised for performance).</p>
*
- * <p><code>'true'</code>, <code>'on'</code> or <code>'yes'</code>
- * (case insensitive) will return <code>true</code>. Otherwise,
- * <code>false</code> is returned.</p>
+ * <p>{@code 'true'}, {@code 'on'} or {@code 'yes'}
+ * (case insensitive) will return {@code true}. Otherwise,
+ * {@code false} is returned.</p>
*
* <p>This method performs 4 times faster (JDK1.4) than
- * <code>Boolean.valueOf(String)</code>. However, this method accepts
+ * {@code Boolean.valueOf(String)}. However, this method accepts
* 'on' and 'yes' as true values.
*
* <pre>
@@ -710,7 +693,7 @@ public class BooleanUtils {
* </pre>
*
* @param str the String to check
- * @return the boolean value of the string, <code>false</code> if no match
or the String is null
+ * @return the boolean value of the string, {@code false} if no match or
the String is null
*/
public static boolean toBoolean(String str) {
return toBooleanObject(str) == Boolean.TRUE;
@@ -727,10 +710,8 @@ public class BooleanUtils {
* </pre>
*
* @param str the String to check
- * @param trueString the String to match for <code>true</code>
- * (case sensitive), may be <code>null</code>
- * @param falseString the String to match for <code>false</code>
- * (case sensitive), may be <code>null</code>
+ * @param trueString the String to match for {@code true} (case
sensitive), may be {@code null}
+ * @param falseString the String to match for {@code false} (case
sensitive), may be {@code null}
* @return the boolean value of the string
* @throws IllegalArgumentException if the String doesn't match
*/
@@ -753,8 +734,8 @@ public class BooleanUtils {
// Boolean to String methods
//-----------------------------------------------------------------------
/**
- * <p>Converts a Boolean to a String returning <code>'true'</code>,
- * <code>'false'</code>, or <code>null</code>.</p>
+ * <p>Converts a Boolean to a String returning {@code 'true'},
+ * {@code 'false'}, or {@code null}.</p>
*
* <pre>
* BooleanUtils.toStringTrueFalse(Boolean.TRUE) = "true"
@@ -763,16 +744,15 @@ public class BooleanUtils {
* </pre>
*
* @param bool the Boolean to check
- * @return <code>'true'</code>, <code>'false'</code>,
- * or <code>null</code>
+ * @return {@code 'true'}, {@code 'false'}, or {@code null}
*/
public static String toStringTrueFalse(Boolean bool) {
return toString(bool, "true", "false", null);
}
/**
- * <p>Converts a Boolean to a String returning <code>'on'</code>,
- * <code>'off'</code>, or <code>null</code>.</p>
+ * <p>Converts a Boolean to a String returning {@code 'on'},
+ * {@code 'off'}, or {@code null}.</p>
*
* <pre>
* BooleanUtils.toStringOnOff(Boolean.TRUE) = "on"
@@ -781,16 +761,15 @@ public class BooleanUtils {
* </pre>
*
* @param bool the Boolean to check
- * @return <code>'on'</code>, <code>'off'</code>,
- * or <code>null</code>
+ * @return {@code 'on'}, {@code 'off'}, or {@code null}
*/
public static String toStringOnOff(Boolean bool) {
return toString(bool, "on", "off", null);
}
/**
- * <p>Converts a Boolean to a String returning <code>'yes'</code>,
- * <code>'no'</code>, or <code>null</code>.</p>
+ * <p>Converts a Boolean to a String returning {@code 'yes'},
+ * {@code 'no'}, or {@code null}.</p>
*
* <pre>
* BooleanUtils.toStringYesNo(Boolean.TRUE) = "yes"
@@ -799,8 +778,7 @@ public class BooleanUtils {
* </pre>
*
* @param bool the Boolean to check
- * @return <code>'yes'</code>, <code>'no'</code>,
- * or <code>null</code>
+ * @return {@code 'yes'}, {@code 'no'}, or {@code null}
*/
public static String toStringYesNo(Boolean bool) {
return toString(bool, "yes", "no", null);
@@ -816,12 +794,9 @@ public class BooleanUtils {
* </pre>
*
* @param bool the Boolean to check
- * @param trueString the String to return if <code>true</code>,
- * may be <code>null</code>
- * @param falseString the String to return if <code>false</code>,
- * may be <code>null</code>
- * @param nullString the String to return if <code>null</code>,
- * may be <code>null</code>
+ * @param trueString the String to return if {@code true}, may be {@code
null}
+ * @param falseString the String to return if {@code false}, may be
{@code null}
+ * @param nullString the String to return if {@code null}, may be {@code
null}
* @return one of the three input Strings
*/
public static String toString(Boolean bool, String trueString, String
falseString, String nullString) {
@@ -834,8 +809,8 @@ public class BooleanUtils {
// boolean to String methods
//-----------------------------------------------------------------------
/**
- * <p>Converts a boolean to a String returning <code>'true'</code>
- * or <code>'false'</code>.</p>
+ * <p>Converts a boolean to a String returning {@code 'true'}
+ * or {@code 'false'}.</p>
*
* <pre>
* BooleanUtils.toStringTrueFalse(true) = "true"
@@ -843,16 +818,15 @@ public class BooleanUtils {
* </pre>
*
* @param bool the Boolean to check
- * @return <code>'true'</code>, <code>'false'</code>,
- * or <code>null</code>
+ * @return {@code 'true'}, {@code 'false'}, or {@code null}
*/
public static String toStringTrueFalse(boolean bool) {
return toString(bool, "true", "false");
}
/**
- * <p>Converts a boolean to a String returning <code>'on'</code>
- * or <code>'off'</code>.</p>
+ * <p>Converts a boolean to a String returning {@code 'on'}
+ * or {@code 'off'}.</p>
*
* <pre>
* BooleanUtils.toStringOnOff(true) = "on"
@@ -860,16 +834,15 @@ public class BooleanUtils {
* </pre>
*
* @param bool the Boolean to check
- * @return <code>'on'</code>, <code>'off'</code>,
- * or <code>null</code>
+ * @return {@code 'on'}, {@code 'off'}, or {@code null}
*/
public static String toStringOnOff(boolean bool) {
return toString(bool, "on", "off");
}
/**
- * <p>Converts a boolean to a String returning <code>'yes'</code>
- * or <code>'no'</code>.</p>
+ * <p>Converts a boolean to a String returning {@code 'yes'}
+ * or {@code 'no'}.</p>
*
* <pre>
* BooleanUtils.toStringYesNo(true) = "yes"
@@ -877,8 +850,7 @@ public class BooleanUtils {
* </pre>
*
* @param bool the Boolean to check
- * @return <code>'yes'</code>, <code>'no'</code>,
- * or <code>null</code>
+ * @return {@code 'yes'}, {@code 'no'}, or {@code null}
*/
public static String toStringYesNo(boolean bool) {
return toString(bool, "yes", "no");
@@ -893,10 +865,8 @@ public class BooleanUtils {
* </pre>
*
* @param bool the Boolean to check
- * @param trueString the String to return if <code>true</code>,
- * may be <code>null</code>
- * @param falseString the String to return if <code>false</code>,
- * may be <code>null</code>
+ * @param trueString the String to return if {@code true}, may be {@code
null}
+ * @param falseString the String to return if {@code false}, may be
{@code null}
* @return one of the two input Strings
*/
public static String toString(boolean bool, String trueString, String
falseString) {
@@ -915,9 +885,9 @@ public class BooleanUtils {
* </pre>
*
* @param array an array of <code>boolean<code>s
- * @return <code>true</code> if the xor is successful.
- * @throws IllegalArgumentException if <code>array</code> is
<code>null</code>
- * @throws IllegalArgumentException if <code>array</code> is empty.
+ * @return {@code true} if the xor is successful.
+ * @throws IllegalArgumentException if {@code array} is {@code null}
+ * @throws IllegalArgumentException if {@code array} is empty.
*/
public static boolean xor(boolean... array) {
// Validates input
@@ -955,10 +925,10 @@ public class BooleanUtils {
* </pre>
*
* @param array an array of <code>Boolean<code>s
- * @return <code>true</code> if the xor is successful.
- * @throws IllegalArgumentException if <code>array</code> is
<code>null</code>
- * @throws IllegalArgumentException if <code>array</code> is empty.
- * @throws IllegalArgumentException if <code>array</code> contains a
<code>null</code>
+ * @return {@code true} if the xor is successful.
+ * @throws IllegalArgumentException if {@code array} is {@code null}
+ * @throws IllegalArgumentException if {@code array} is empty.
+ * @throws IllegalArgumentException if {@code array} contains a {@code
null}
*/
public static Boolean xor(Boolean... array) {
if (array == null) {