public class BooleanUtils
extends Object
Provides extra functionality for boolean
primitives.
Constructor and Description |
---|
BooleanUtils() |
Modifier and Type | Method and Description |
---|---|
static Boolean[] |
asObjectArray(boolean[] array)
Converts from a
boolean array to a Boolean array. |
static boolean[] |
asPrimitiveArray(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(Collection<Boolean> list)
Converts a collection (
List , Set ...) of Boolean objects to a boolean array. |
static List<Boolean> |
toList(boolean[] array)
Converts from a
boolean array to a list. |
public static Boolean[] asObjectArray(boolean[] array)
boolean
array to a Boolean
array.array
- boolean
arrayBoolean
arraypublic static boolean[] asPrimitiveArray(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.indexes
public 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(Collection<Boolean> list)
List
, Set
...) of Boolean
objects to a boolean
array.list
- Input listboolean
arraypublic static List<Boolean> toList(boolean[] array)
boolean
array to a list.array
- Input arrayBoolean
objects