I am trying to collect some property from list of objects into array using RxJava. I've wrote the code, but now I can't cast return type properly. So, I've tried this code:
.map((range) -> String.format(Locale.getDefault(), "%s (%d)", range, range.getElementNumber()))
You could use the
It is well described in the documentation:
Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array. If the list fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list.