public final class BooleanHelper extends Object
Modifier and Type | Method | Description |
---|---|---|
static Boolean |
getNullSafe(Boolean bool) |
Returns a non-null boolean, even if the object being passed is a null boolean.
|
public static Boolean getNullSafe(Boolean bool)
Boolean bool1 = true; Boolean bool2 = null; Boolean bool3 = BooleanHelper.getNullSafe(bool1); Boolean bool4 = BooleanHelper.getNullSafe(bool2); // bool3 now contains the boolean: true // bool4 now contains the boolean: false
bool
- The boolean to safeguard against null
.null
then Boolean.FALSE
.Copyright © 2008, 2018, Shaiksphere Inc.. All rights reserved.