sdk-common / com.tomtom.online.sdk.common.functional.collections / Lists / limit

limit

static fun <A : Any!> limit(@NonNull list: MutableList<A>, maxSize: Int): MutableList<A>!

Creates new list based on provided list that contains no more than provide max size count.

Parameters

list - MutableList<A>: list that is going to be processed

maxSize - Int: maximum number of elements that new list should contain.

- value type

Return
MutableList<A>!: new list that contains no more than maxSize elements