Package com.google.common.collect
Class ObjectArrays
- java.lang.Object
-
- com.google.common.collect.ObjectArrays
-
@GwtCompatible(emulated=true) @Deprecated(since="2022-12-01") public final class ObjectArrays extends java.lang.Object
Deprecated.The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023Static utility methods pertaining to object arrays.- Since:
- 2.0 (imported from Google Collections Library)
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T> T[]concat(T[] array, T element)Deprecated.Returns a new array that appendselementtoarray.static <T> T[]concat(T[] first, T[] second, java.lang.Class<T> type)Deprecated.Returns a new array that contains the concatenated contents of two arrays.static <T> T[]concat(T element, T[] array)Deprecated.Returns a new array that prependselementtoarray.static <T> T[]newArray(java.lang.Class<T> type, int length)Deprecated.Returns a new array of the given length with the specified component type.static <T> T[]newArray(T[] reference, int length)Deprecated.Returns a new array of the given length with the same type as a reference array.
-
-
-
Method Detail
-
newArray
@GwtIncompatible("Array.newInstance(Class, int)") public static <T> T[] newArray(java.lang.Class<T> type, int length)
Deprecated.Returns a new array of the given length with the specified component type.- Parameters:
type- the component typelength- the length of the new array
-
newArray
public static <T> T[] newArray(T[] reference, int length)Deprecated.Returns a new array of the given length with the same type as a reference array.- Parameters:
reference- any array of the desired typelength- the length of the new array
-
concat
@GwtIncompatible("Array.newInstance(Class, int)") public static <T> T[] concat(T[] first, T[] second, java.lang.Class<T> type)
Deprecated.Returns a new array that contains the concatenated contents of two arrays.- Parameters:
first- the first array of elements to concatenatesecond- the second array of elements to concatenatetype- the component type of the returned array
-
concat
public static <T> T[] concat(@Nullable T element, T[] array)Deprecated.Returns a new array that prependselementtoarray.- Parameters:
element- the element to prepend to the front ofarrayarray- the array of elements to append- Returns:
- an array whose size is one larger than
array, withelementoccupying the first position, and the elements ofarrayoccupying the remaining elements.
-
concat
public static <T> T[] concat(T[] array, @Nullable T element)Deprecated.Returns a new array that appendselementtoarray.- Parameters:
array- the array of elements to prependelement- the element to append to the end- Returns:
- an array whose size is one larger than
array, with the same contents asarray, pluselementoccupying the last position.
-
-