I am trying to call this method to concat two arrays using Google Collections
public static <T> T[] concat(T[] first,
T[] second,
Class<T> type)
It’s returning empty results. I am using
ObjectArrays.concat(array1, array2, Blah.class)
which is the only thing that compiles.
array1 and array2 are of type Blah[].
What’s the right syntax?
Bonus question: do other collections libraries have documentation with examples?
Edit: Problem was my bone-headed code.
public void register(ButtonPair[] pairs) {
pairs = ObjectArrays.concat(this.pairs, pairs, ButtonPair.class);
}
the right side of the thing is okay, but the left side is not assigning to this.pairs due to the ambiguity. Sorry! And hats off to Google Collections!
The following worked for me:
How are you getting the result from concat()?