Remove isTrue to BooleanUtils
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137183 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
24bc34a7af
commit
31bf101e02
|
@ -74,7 +74,7 @@ import org.apache.commons.lang.exception.NestableRuntimeException;
|
|||
* @author <a href="mailto:rand_mcneely@yahoo.com">Rand McNeely</a>
|
||||
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
|
||||
* @author <a href="mailto:fredrik@westermarck.com">Fredrik Westermarck</a>
|
||||
* @version $Id: StringUtils.java,v 1.28 2002/12/07 21:50:29 bayard Exp $
|
||||
* @version $Id: StringUtils.java,v 1.29 2002/12/15 16:54:23 scolebourne Exp $
|
||||
*/
|
||||
public class StringUtils {
|
||||
|
||||
|
@ -1652,28 +1652,6 @@ public class StringUtils {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Checks if the String contains a 'true' value.</p>
|
||||
*
|
||||
* <p>These values are defined as the words
|
||||
* <code>'true'</code>, <code>'on'</code> and
|
||||
* <code>'yes'</code>, case insensitive.</p>
|
||||
*
|
||||
* @param str the String to check
|
||||
* @return <code>true</code> if the string is 'true|on|yes' case
|
||||
* insensitive
|
||||
*/
|
||||
public static boolean isTrue(String str) {
|
||||
if ("true".equalsIgnoreCase(str)) {
|
||||
return true;
|
||||
} else if ("on".equalsIgnoreCase(str)) {
|
||||
return true;
|
||||
} else if ("yes".equalsIgnoreCase(str)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Defaults
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ import junit.textui.TestRunner;
|
|||
* Unit tests {@link org.apache.commons.lang.StringUtils} - Substring methods
|
||||
*
|
||||
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
|
||||
* @version $Id: StringUtilsIsTest.java,v 1.3 2002/11/15 00:06:40 scolebourne Exp $
|
||||
* @version $Id: StringUtilsIsTest.java,v 1.4 2002/12/15 16:54:23 scolebourne Exp $
|
||||
*/
|
||||
public class StringUtilsIsTest extends TestCase {
|
||||
|
||||
|
@ -131,20 +131,6 @@ public class StringUtilsIsTest extends TestCase {
|
|||
assertEquals(false, StringUtils.isWhitespace("aba"));
|
||||
}
|
||||
|
||||
public void testIsTrue() {
|
||||
assertEquals(false, StringUtils.isTrue(null));
|
||||
assertEquals(false, StringUtils.isTrue(""));
|
||||
assertEquals(false, StringUtils.isTrue("off"));
|
||||
assertEquals(false, StringUtils.isTrue("oof"));
|
||||
assertEquals(true, StringUtils.isTrue("true"));
|
||||
assertEquals(true, StringUtils.isTrue("yes"));
|
||||
assertEquals(true, StringUtils.isTrue("on"));
|
||||
assertEquals(true, StringUtils.isTrue("TRUE"));
|
||||
assertEquals(true, StringUtils.isTrue("ON"));
|
||||
assertEquals(true, StringUtils.isTrue("YES"));
|
||||
assertEquals(true, StringUtils.isTrue("TruE"));
|
||||
}
|
||||
|
||||
public void testIsAlphaspace() {
|
||||
assertEquals(false, StringUtils.isAlphaSpace(null));
|
||||
assertEquals(true, StringUtils.isAlphaSpace(""));
|
||||
|
|
Loading…
Reference in New Issue