Class ArrayHelper<E>

  • Type Parameters:
    E -

    public class ArrayHelper<E>
    extends Object
    Helper-class for using arrays.
    • Constructor Detail

      • ArrayHelper

        public ArrayHelper()
    • Method Detail

      • getArrayAsString

        public String getArrayAsString​(String split,
                                       E... array)
        Returns the given array as a string. The string split is appended to the array for each item.
        If split == null, a System.lineseparator is taken!
        Parameters:
        split -
        array -
        Returns:
      • improveItemInArray

        public boolean improveItemInArray​(E obj,
                                          E... array)
        Checks whether an item is present in the passed array.
        If so, true is returned, otherwise false.
        Parameters:
        obj -
        array -
        Returns:
      • improveArrays

        public boolean improveArrays​(E[] array1,
                                     E[] array2)
        Checks the contents of two arrays. These must be the same size!
        If the contents from the array1 are all the same with the contents
        (regardless of the position of the respective items in the two lists!)
        are array2 true is returned, otherwise false.
        Parameters:
        array1 -
        array2 -
        Returns:
      • isArrayEmpty

        public boolean isArrayEmpty​(E[] array)
        Returns true if the array is empty, false otherwise.
        Parameters:
        array -
        Returns: