Class ArrayUtils

java.lang.Object
org.apache.commons.lang3.ArrayUtils
net.sf.jstuff.core.collection.ArrayUtils

public abstract class ArrayUtils extends org.apache.commons.lang3.ArrayUtils
Author:
Sebastian Thomschke
  • Field Summary

    Fields inherited from class org.apache.commons.lang3.ArrayUtils

    EMPTY_BOOLEAN_ARRAY, EMPTY_BOOLEAN_OBJECT_ARRAY, EMPTY_BYTE_ARRAY, EMPTY_BYTE_OBJECT_ARRAY, EMPTY_CHAR_ARRAY, EMPTY_CHARACTER_OBJECT_ARRAY, EMPTY_CLASS_ARRAY, EMPTY_DOUBLE_ARRAY, EMPTY_DOUBLE_OBJECT_ARRAY, EMPTY_FIELD_ARRAY, EMPTY_FLOAT_ARRAY, EMPTY_FLOAT_OBJECT_ARRAY, EMPTY_INT_ARRAY, EMPTY_INTEGER_OBJECT_ARRAY, EMPTY_LONG_ARRAY, EMPTY_LONG_OBJECT_ARRAY, EMPTY_METHOD_ARRAY, EMPTY_OBJECT_ARRAY, EMPTY_SHORT_ARRAY, EMPTY_SHORT_OBJECT_ARRAY, EMPTY_STRING_ARRAY, EMPTY_THROWABLE_ARRAY, EMPTY_TYPE_ARRAY, INDEX_NOT_FOUND
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T[]
    addAll(T[] arr, @Nullable Collection<T> coll)
     
    static <T> T[]
    asArray(T... values)
     
    static <T> T @Nullable []
    asArrayNullable(T @Nullable ... values)
     
    static <T> boolean
    containsIdentical(T @Nullable [] searchIn, T searchFor)
     
    static boolean
    containsIgnoringCase(String @Nullable [] searchIn, String searchFor)
     
    static <T> boolean
    containsNulls(T @Nullable [] array)
     
    static <T> T[]
    filter(Predicate<? super T> filter, T... array)
     
    static <T> T @Nullable []
    filterNullable(Predicate<? super T> filter, T @Nullable ... array)
     
    static <T> Class<T>
    getComponentType(T[] array)
     
    static <T> T[]
    intersect(T[]... arrays)
     
    static <T> T @Nullable []
    intersectNullable(T[] @Nullable ... arrays)
     
    static <T> T[]
    toArray(Collection<T> values, Class<T> itemType)
     
    static byte[]
    toByteArray(char[] chars, int off, int len, Charset charset)
     
    static byte[]
    toByteArray(char[] chars, Charset charset)
    About 30% faster than new String(chars).getBytes("UTF-8")
    static List<Boolean>
    toList(boolean... array)
     
    static List<Byte>
    toList(byte... array)
     
    static List<Character>
    toList(char... array)
     
    static List<Double>
    toList(double... array)
     
    static List<Float>
    toList(float... array)
     
    static List<Integer>
    toList(int... array)
     
    static List<Long>
    toList(long... array)
     
    static List<Short>
    toList(short... array)
     
    static <T> List<T>
    toList(Object array, Class<T> itemType)
     
    static <T> List<T>
    toList(T... array)
     
    static <S, T> T[]
    transform(S[] source, Class<T> targetType, Function<? super S,? extends T> op)
     
    static <S, T> T @Nullable []
    transformNullable(S @Nullable [] source, Class<T> targetType, Function<? super S,? extends T> op)
     

    Methods inherited from class org.apache.commons.lang3.ArrayUtils

    add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addFirst, addFirst, addFirst, addFirst, addFirst, addFirst, addFirst, addFirst, addFirst, arraycopy, arraycopy, arraycopy, clone, clone, clone, clone, clone, clone, clone, clone, clone, contains, contains, contains, contains, contains, contains, contains, contains, contains, contains, containsAny, get, get, getLength, hashCode, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, insert, insert, insert, insert, insert, insert, insert, insert, insert, isArrayIndexValid, isEmpty, isEmpty, isEmpty, isEmpty, isEmpty, isEmpty, isEmpty, isEmpty, isEmpty, isEquals, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, isSameLength, isSameLength, isSameLength, isSameLength, isSameLength, isSameLength, isSameLength, isSameLength, isSameLength, isSameLength, isSameType, isSorted, isSorted, isSorted, isSorted, isSorted, isSorted, isSorted, isSorted, isSorted, isSorted, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, newInstance, nullTo, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, remove, remove, remove, remove, remove, remove, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeElement, removeElement, removeElement, removeElement, removeElement, removeElement, removeElement, removeElement, removeElement, removeElements, removeElements, removeElements, removeElements, removeElements, removeElements, removeElements, removeElements, removeElements, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, setAll, setAll, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, subarray, subarray, subarray, subarray, subarray, subarray, subarray, subarray, subarray, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, toArray, toMap, toObject, toObject, toObject, toObject, toObject, toObject, toObject, toObject, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toString, toString, toStringArray, toStringArray

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ArrayUtils

      protected ArrayUtils()
  • Method Details

    • addAll

      public static <T> T[] addAll(T[] arr, @Nullable Collection<T> coll)
    • asArray

      public static <T> T[] asArray(T... values)
    • asArrayNullable

      public static <T> T @Nullable [] asArrayNullable(T @Nullable ... values)
    • containsNulls

      public static <T> boolean containsNulls(T @Nullable [] array)
    • containsIdentical

      public static <T> boolean containsIdentical(T @Nullable [] searchIn, T searchFor)
    • containsIgnoringCase

      public static boolean containsIgnoringCase(String @Nullable [] searchIn, String searchFor)
    • getComponentType

      public static <T> Class<T> getComponentType(T[] array)
    • filter

      public static <T> T[] filter(Predicate<? super T> filter, T... array)
      Returns:
      a new array with all items accepted by the filter
    • filterNullable

      public static <T> T @Nullable [] filterNullable(Predicate<? super T> filter, T @Nullable ... array)
      Returns:
      a new array with all items accepted by the filter or null if array == null
    • intersect

      public static <T> T[] intersect(T[]... arrays)
      Returns:
      all items that are contained in all arrays.
    • intersectNullable

      public static <T> T @Nullable [] intersectNullable(T[] @Nullable ... arrays)
      Returns:
      all items that are contained in all arrays.
    • toArray

      public static <T> T[] toArray(Collection<T> values, Class<T> itemType)
    • toByteArray

      public static byte[] toByteArray(char[] chars, Charset charset)
      About 30% faster than new String(chars).getBytes("UTF-8")
    • toByteArray

      public static byte[] toByteArray(char[] chars, int off, int len, Charset charset)
    • toList

      public static List<Boolean> toList(boolean... array)
    • toList

      public static List<Byte> toList(byte... array)
    • toList

      public static List<Character> toList(char... array)
    • toList

      public static List<Double> toList(double... array)
    • toList

      public static List<Float> toList(float... array)
    • toList

      public static List<Integer> toList(int... array)
    • toList

      public static List<Long> toList(long... array)
    • toList

      public static <T> List<T> toList(Object array, Class<T> itemType)
    • toList

      public static List<Short> toList(short... array)
    • toList

      @SafeVarargs public static <T> List<T> toList(T... array)
    • transform

      public static <S, T> T[] transform(S[] source, Class<T> targetType, Function<? super S,? extends T> op)
    • transformNullable

      public static <S, T> T @Nullable [] transformNullable(S @Nullable [] source, Class<T> targetType, Function<? super S,? extends T> op)