Class ArrayHelper
java.lang.Object
org.hibernate.internal.util.collections.ArrayHelper
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> void
addAll
(Collection<T> collection, T[] array) static int[]
calculateBatchPartitions
(int mappedBatchSize) Calculate the batch partitions needed to handle themappedBatchSize
.static boolean
contains
(int[] array, int value) static boolean
static int
countNonNull
(Serializable[] array) static int
countNonNull
(Object[] array) static int
countTrue
(boolean... array) static Serializable[]
extractNonNull
(Serializable[] array) static int[]
fillArray
(int value, int length) static String[]
static LockMode[]
static LockOptions[]
fillArray
(LockOptions lockOptions, int length) static <T> T[]
filledArray
(T value, Class<T> valueJavaType, int size) static <T> void
static int[]
getBatchSizes
(int maxBatchSize) static int
hash
(byte[] bytes) calculate the array hash (only the first level)static int
hash
(char[] array) calculate the array hash (only the first level)static int
calculate the array hash (only the first level)static int
static int
static boolean
isAllFalse
(boolean... array) static boolean
isAllNegative
(int[] array) static boolean
isAllTrue
(boolean... array) static boolean
isAnyTrue
(boolean... values) static boolean
static int[]
join
(int[] x, int[] y) static String[]
static String[]
static <T> T[]
join
(T[] x, T... y) static boolean[]
negate
(boolean[] valueNullness) static <T> T[]
newInstance
(Class<T> elementType, int length) static String[]
static Object[]
static String[]
static int[][]
to2DIntArray
(Collection<int[]> coll) static String[][]
to2DStringArray
(Collection<String[]> coll) static boolean[]
toBooleanArray
(Collection<Boolean> coll) static <T> List<T>
toExpandableList
(T[] values) static int[]
toIntArray
(Collection<Integer> coll) static <T> List<T>
static Object[]
toObjectArray
(Object array) static Object[]
toObjectArray
(Collection<Object> coll) static String
static String[]
toStringArray
(Object[] objects) static String[]
toStringArray
(Collection<String> coll) static Type[]
toTypeArray
(Collection<Type> coll) static int[]
trim
(int[] from, int length) static Object[]
-
Field Details
-
TRUE
public static final boolean[] TRUE -
FALSE
public static final boolean[] FALSE -
EMPTY_STRING_ARRAY
-
EMPTY_INT_ARRAY
public static final int[] EMPTY_INT_ARRAY -
EMPTY_BOOLEAN_ARRAY
public static final boolean[] EMPTY_BOOLEAN_ARRAY -
EMPTY_CLASS_ARRAY
-
EMPTY_OBJECT_ARRAY
-
EMPTY_TYPE_ARRAY
-
EMPTY_BYTE_ARRAY
public static final byte[] EMPTY_BYTE_ARRAY
-
-
Method Details
-
contains
-
contains
public static boolean contains(int[] array, int value) -
indexOf
-
indexOf
-
filledArray
-
toStringArray
-
fillArray
-
fillArray
public static int[] fillArray(int value, int length) -
fillArray
-
fillArray
-
toStringArray
-
toObjectArray
-
to2DStringArray
-
to2DIntArray
-
toTypeArray
-
toIntArray
-
toBooleanArray
-
typecast
-
slice
-
slice
-
toList
-
join
-
join
-
join
public static int[] join(int[] x, int[] y) -
join
public static <T> T[] join(T[] x, T... y) -
toString
-
isAllNegative
public static boolean isAllNegative(int[] array) -
isAllTrue
public static boolean isAllTrue(boolean... array) -
countTrue
public static int countTrue(boolean... array) -
isAllFalse
public static boolean isAllFalse(boolean... array) -
isAnyTrue
public static boolean isAnyTrue(boolean... values) -
negate
public static boolean[] negate(boolean[] valueNullness) -
addAll
-
calculateBatchPartitions
public static int[] calculateBatchPartitions(int mappedBatchSize) Calculate the batch partitions needed to handle themappedBatchSize
.- Parameters:
mappedBatchSize
- Thebatch-size
. Internally this is capped at256
- Returns:
- The upper bound for the partitions
- Implementation Note:
- The max batch size is capped at
256
-
getBatchSizes
public static int[] getBatchSizes(int maxBatchSize) -
hash
calculate the array hash (only the first level) -
hash
public static int hash(char[] array) calculate the array hash (only the first level) -
hash
public static int hash(byte[] bytes) calculate the array hash (only the first level) -
extractNonNull
-
countNonNull
-
countNonNull
-
reverse
-
trim
public static int[] trim(int[] from, int length) -
toObjectArray
-
toExpandableList
-
isEmpty
-
forEach
-
newInstance
-