Codota Logo
BooleanUtils.toIntegerObject
Code IndexAdd Codota to your IDE (free)

How to use
toIntegerObject
method
in
org.apache.commons.lang3.BooleanUtils

Best Java code snippets using org.apache.commons.lang3.BooleanUtils.toIntegerObject (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: org.apache.commons/commons-lang3

@Test
public void test_toIntegerObject_boolean() {
  assertEquals(Integer.valueOf(1), BooleanUtils.toIntegerObject(true));
  assertEquals(Integer.valueOf(0), BooleanUtils.toIntegerObject(false));
}
origin: org.apache.commons/commons-lang3

@Test
public void test_toIntegerObject_Boolean_Integer_Integer_Integer() {
  final Integer six = Integer.valueOf(6);
  final Integer seven = Integer.valueOf(7);
  final Integer eight = Integer.valueOf(8);
  assertEquals(six, BooleanUtils.toIntegerObject(Boolean.TRUE, six, seven, eight));
  assertEquals(seven, BooleanUtils.toIntegerObject(Boolean.FALSE, six, seven, eight));
  assertEquals(eight, BooleanUtils.toIntegerObject(null, six, seven, eight));
  assertNull(BooleanUtils.toIntegerObject(null, six, seven, null));
}
origin: org.apache.commons/commons-lang3

@Test
public void test_toIntegerObject_Boolean() {
  assertEquals(Integer.valueOf(1), BooleanUtils.toIntegerObject(Boolean.TRUE));
  assertEquals(Integer.valueOf(0), BooleanUtils.toIntegerObject(Boolean.FALSE));
  assertNull(BooleanUtils.toIntegerObject(null));
}
origin: org.apache.commons/commons-lang3

@Test
public void test_toIntegerObject_boolean_Integer_Integer() {
  final Integer six = Integer.valueOf(6);
  final Integer seven = Integer.valueOf(7);
  assertEquals(six, BooleanUtils.toIntegerObject(true, six, seven));
  assertEquals(seven, BooleanUtils.toIntegerObject(false, six, seven));
}
org.apache.commons.lang3BooleanUtilstoIntegerObject

Javadoc

Converts a Boolean to a Integer using the convention that zero is false.

null will be converted to null.

 
BooleanUtils.toIntegerObject(Boolean.TRUE)  = Integer.valueOf(1) 
BooleanUtils.toIntegerObject(Boolean.FALSE) = Integer.valueOf(0) 

Popular methods of BooleanUtils

  • toBoolean
    Converts a String to a Boolean throwing an exception if no match found. BooleanUtils.toBoolean("t
  • isTrue
    Checks if a Boolean value is true, handling null by returning false. BooleanUtils.isTrue(Boolean.
  • toBooleanObject
    Converts a String to a Boolean throwing an exception if no match. NOTE: This returns null and will
  • isFalse
    Checks if a Boolean value is false, handling null by returning false. BooleanUtils.isFalse(Boolea
  • isNotTrue
    Checks if a Boolean value is not true, handling null by returning true. BooleanUtils.isNotTrue(Bo
  • toStringTrueFalse
    Converts a boolean to a String returning 'true'or 'false'. BooleanUtils.toStringTrueFalse(true)
  • toBooleanDefaultIfNull
    Converts a Boolean to a boolean handling null. BooleanUtils.toBooleanDefaultIfNull(Boolean.TRUE,
  • toString
    Converts a boolean to a String returning one of the input Strings. BooleanUtils.toString(true, "t
  • isNotFalse
    Checks if a Boolean value is not false, handling null by returning true. BooleanUtils.isNotFalse(
  • or
    Performs an or on a set of booleans. BooleanUtils.or(true, true) = true BooleanUtils.or
  • and
    Performs an and on a set of booleans. BooleanUtils.and(true, true) = true BooleanUtils.a
  • toStringYesNo
    Converts a boolean to a String returning 'yes'or 'no'. BooleanUtils.toStringYesNo(true) = "yes"
  • and,
  • toStringYesNo,
  • xor,
  • toInteger,
  • compare,
  • negate,
  • toStringOnOff,
  • <init>

Popular in Java

  • Updating database using SQL prepared statement
  • startActivity (Activity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • onRequestPermissionsResult (Fragment)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Runner (org.openjdk.jmh.runner)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now