Skip to content

Latest commit

 

History

History
25 lines (22 loc) · 721 Bytes

File metadata and controls

25 lines (22 loc) · 721 Bytes

Core Collections

A set of extensions to work with collections

CollectionsExtensions

Sample usage:

val someCollection = mutableListOf<String>()
val someOtherCollection = listOf("String", "String2")

if(someCollection.isNotNullOrEmpty()){
    someCollection.replace(someOtherCollection)
}

Sample usage of working with Predicate:

 val favoritesPredicates = arrayListOf<Predicate<UserContact>>(
            Predicate { it.isStarred },
            Predicate { !it.isStarred }
    )
 val result: SparseArray<List<UserContact>> = originalCollection.split(favoritesPredicates)

For full list of functions, please look to the source code, or view documentation