Class ArrayUtil


  • public class ArrayUtil
    extends Object
    Utility to transform arrays and list of objects to primitives.
    The code has been changed in order to be aligned with internal needs, taking the source from ArrayUtils of Apache common lang3..
    • Field Detail

      • EMPTY_BOOLEAN_ARRAY

        public static final boolean[] EMPTY_BOOLEAN_ARRAY
        An empty immutable boolean array.
      • EMPTY_BOOLEAN_OBJECT_ARRAY

        public static final Boolean[] EMPTY_BOOLEAN_OBJECT_ARRAY
        An empty immutable Boolean array.
      • EMPTY_DOUBLE_ARRAY

        public static final double[] EMPTY_DOUBLE_ARRAY
        An empty immutable double array.
      • EMPTY_DOUBLE_OBJECT_ARRAY

        public static final Double[] EMPTY_DOUBLE_OBJECT_ARRAY
        An empty immutable Double array.
      • EMPTY_INT_ARRAY

        public static final int[] EMPTY_INT_ARRAY
        An empty immutable int array.
      • EMPTY_INTEGER_OBJECT_ARRAY

        public static final Integer[] EMPTY_INTEGER_OBJECT_ARRAY
        An empty immutable Integer array.
      • EMPTY_STRING_ARRAY

        public static final String[] EMPTY_STRING_ARRAY
        An empty immutable String array.
      • EMPTY_DATE_ARRAY

        public static final Date[] EMPTY_DATE_ARRAY
        An empty immutable Date array.
      • EMPTY_DATA_POINT_ARRAY

        public static final DataPoint[] EMPTY_DATA_POINT_ARRAY
        An empty immutable DataPoint array.
      • EMPTY_COLORS_ARRAY

        public static final IsColor[] EMPTY_COLORS_ARRAY
        An empty immutable IsColor array.
      • EMPTY_BORDER_SKIPPED_ARRAY

        public static final BorderSkipped[] EMPTY_BORDER_SKIPPED_ARRAY
        An empty immutable BorderSkipped array.
      • EMPTY_BORDER_ALIGN_ARRAY

        public static final BorderAlign[] EMPTY_BORDER_ALIGN_ARRAY
        An empty immutable BorderAlign array.
      • EMPTY_KEY_ARRAY

        public static final Key[] EMPTY_KEY_ARRAY
        An empty immutable Key array.
      • EMPTY_MEASURE_UNIT_ARRAY

        public static final MeasureUnit[] EMPTY_MEASURE_UNIT_ARRAY
        An empty immutable MeasureUnit array.
      • EMPTY_ACTION_ITEM_ARRAY

        public static final ActionItem[] EMPTY_ACTION_ITEM_ARRAY
        An empty immutable ActionItem array.
      • EMPTY_EVENT_BUTTON_ARRAY

        public static final EventButton[] EMPTY_EVENT_BUTTON_ARRAY
        An empty immutable EventButton array.
    • Method Detail

      • getLength

        public static int getLength​(Object array)
        Returns the length of the passed array.
        If argument is null, 0 is returned.
        Parameters:
        array - the array to get the length
        Returns:
        the length of the array
      • isEmpty

        public static boolean isEmpty​(boolean[] array)
        Returns true if the array is empty.
        Parameters:
        array - the array to check
        Returns:
        true if the array is empty
      • isEmpty

        public static boolean isEmpty​(double[] array)
        Returns true if the array is empty.
        Parameters:
        array - the array to check
        Returns:
        true if the array is empty
      • isEmpty

        public static boolean isEmpty​(int[] array)
        Returns true if the array is empty.
        Parameters:
        array - the array to check
        Returns:
        true if the array is empty
      • isEmpty

        public static boolean isEmpty​(Object[] array)
        Returns true if the array is empty.
        Parameters:
        array - the array to check
        Returns:
        true if the array is empty
      • isNotEmpty

        public static boolean isNotEmpty​(boolean[] array)
        Returns true if the array is empty.
        Parameters:
        array - the array to check
        Returns:
        true if the array is empty
      • isNotEmpty

        public static boolean isNotEmpty​(double[] array)
        Returns true if the array is empty.
        Parameters:
        array - the array to check
        Returns:
        true if the array is empty
      • isNotEmpty

        public static boolean isNotEmpty​(int[] array)
        Returns true if the array is empty.
        Parameters:
        array - the array to check
        Returns:
        true if the array is empty
      • isNotEmpty

        public static boolean isNotEmpty​(Object[] array)
        Returns true if the array is empty.
        Parameters:
        array - the array to check
        Returns:
        true if the array is empty
      • toBooleans

        public static boolean[] toBooleans​(List<Boolean> list)
        Returns an array of primitives from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of primitives from a list
      • toPrimitive

        public static boolean[] toPrimitive​(Boolean[] array)
        Returns an array of primitives from an array of objects.
        Parameters:
        array - array of objects to transform
        Returns:
        an array of primitives from passed array
      • toDoubles

        public static double[] toDoubles​(List<Double> list)
        Returns an array of primitives from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of primitives from a list
      • toPrimitive

        public static double[] toPrimitive​(Double[] array)
        Returns an array of primitives from an array of objects.
        Parameters:
        array - array of objects to transform
        Returns:
        an array of primitives from passed array
      • toIntegers

        public static int[] toIntegers​(List<Integer> list)
        Returns an array of primitives from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of primitives from a list
      • toPrimitive

        public static int[] toPrimitive​(Integer[] array)
        Returns an array of primitives from an array of objects.
        Parameters:
        array - array of objects to transform
        Returns:
        an array of primitives from passed array
      • toStrings

        public static String[] toStrings​(List<String> list)
        Returns an array of strings from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of strings from a list
      • toDates

        public static Date[] toDates​(List<Date> list)
        Returns an array of dates from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of dates from a list
      • toDataPoints

        public static DataPoint[] toDataPoints​(List<DataPoint> list)
        Returns an array of dates from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of dates from a list
      • toTimeSeriesItems

        public static TimeSeriesItem[] toTimeSeriesItems​(List<TimeSeriesItem> list)
        Returns an array of dates from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of dates from a list
      • toColors

        public static IsColor[] toColors​(List<IsColor> list)
        Returns an array of dates from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of dates from a list
      • toBorderSkipped

        public static BorderSkipped[] toBorderSkipped​(List<BorderSkipped> list)
        Returns an array of dates from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of dates from a list
      • toBorderAlign

        public static BorderAlign[] toBorderAlign​(List<BorderAlign> list)
        Returns an array of dates from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of dates from a list
      • toKeys

        public static Key[] toKeys​(List<Key> list)
        Returns an array of dates from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of dates from a list
      • toMeasureUnits

        public static MeasureUnit[] toMeasureUnits​(List<MeasureUnit> list)
        Returns an array of dates from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of dates from a list
      • toActionItems

        public static ActionItem[] toActionItems​(List<ActionItem> list)
        Returns an array of dates from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of dates from a list
      • toEventButtons

        public static EventButton[] toEventButtons​(List<EventButton> list)
        Returns an array of dates from a list.
        Parameters:
        list - list of objects to transform
        Returns:
        an array of dates from a list