public class BooleanUtils
extends java.lang.Object
Provides extra functionality for boolean primitives.
| Constructor and Description |
|---|
BooleanUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Boolean[] |
asObjectArray(boolean[] array)
Converts from a
boolean array to a Boolean array. |
static boolean[] |
asPrimitiveArray(java.lang.Boolean[] array)
Converts from a
Boolean array to a boolean array. |
static int[] |
find(boolean[] array,
boolean value,
Constants.SearchType searchType)
Returns the position(s) where a given value can be found into an array.
|
static boolean[] |
select(boolean[] array,
int[] indexes)
Returns a set of selected elements from an input array.
|
static boolean[] |
toArray(java.util.Collection<java.lang.Boolean> list)
Converts a collection (
List, Set...) of Boolean objects to a boolean array. |
static java.util.List<java.lang.Boolean> |
toList(boolean[] array)
Converts from a
boolean array to a list. |
public static java.lang.Boolean[] asObjectArray(boolean[] array)
boolean array to a Boolean array.array - boolean arrayBoolean arraypublic static boolean[] asPrimitiveArray(java.lang.Boolean[] array)
Boolean array to a boolean array.array - Boolean arrayboolean arraypublic static boolean[] select(boolean[] array,
int[] indexes)
array - Input arrayindexes - Position of elements to be selected.indexespublic static int[] find(boolean[] array,
boolean value,
Constants.SearchType searchType)
array - Input arrayvalue - Value to be searched forsearchType - Indicates whether the first, the last, or all minimum positions are returnedpublic static boolean[] toArray(java.util.Collection<java.lang.Boolean> list)
List, Set...) of Boolean objects to a boolean array.list - Input listboolean arraypublic static java.util.List<java.lang.Boolean> toList(boolean[] array)
boolean array to a list.array - Input arrayBoolean objects