Android Utililty Methods Array Empty Check

List of utility methods to do Array Empty Check

Description

The list of methods to do Array Empty Check are organized into topic(s).

Method

booleanisEmpty(int[] array)

Checks if an array of primitive ints is empty or null.

return array == null || array.length == 0;
booleanisEmpty(long[] array)

Checks if an array of primitive longs is empty or null.

return array == null || array.length == 0;
booleanisEmpty(short[] array)

Checks if an array of primitive shorts is empty or null.

return array == null || array.length == 0;
booleanisNotEmpty(T[] array)

Checks if an array of Objects is not empty or not null.

return (array != null && array.length != 0);
booleanisNotEmpty(T[] array)
Checks whether the provided array is empty (i.e is not null and has non-empty length).
return (array != null && array.length > 0);
booleanisNotEmpty(boolean[] array)

Checks if an array of primitive booleans is not empty or not null.

return (array != null && array.length != 0);
booleanisNotEmpty(byte[] array)

Checks if an array of primitive bytes is not empty or not null.

return (array != null && array.length != 0);
booleanisNotEmpty(char[] array)

Checks if an array of primitive chars is not empty or not null.

return (array != null && array.length != 0);
booleanisNotEmpty(double[] array)

Checks if an array of primitive doubles is not empty or not null.

return (array != null && array.length != 0);
booleanisNotEmpty(float[] array)

Checks if an array of primitive floats is not empty or not null.

return (array != null && array.length != 0);