Java Boolean From toBooleanDefaultIfNull(Boolean bool, boolean valueIfNull)

Here you can find the source of toBooleanDefaultIfNull(Boolean bool, boolean valueIfNull)

Description

to Boolean Default If Null

License

Mozilla Public License

Declaration

public static boolean toBooleanDefaultIfNull(Boolean bool, boolean valueIfNull) 

Method Source Code

//package com.java2s;
//License from project: Mozilla Public License 

public class Main {
    public static boolean toBooleanDefaultIfNull(Boolean bool, boolean valueIfNull) {
        if (bool == null) {
            return valueIfNull;
        }/*from  w w  w  .  j  a v  a 2  s .c  om*/

        return bool;
    }
}

Related

  1. toBooleanArray(final E[] array)
  2. toBooleanArray(final Object[] array)
  3. toBooleanArray(int[] intArray, int n)
  4. toBooleanArray(Object[] vs)
  5. toBooleanDefaultIfNull(Boolean bool, boolean valueIfNull)
  6. toBooleanObject(final int val)
  7. toBooleanObject(final String str)
  8. toBooleanObject(int value, int trueValue, int falseValue, int nullValue)
  9. toBooleanObject(int value, int trueValue, int falseValue, int nullValue)