added collection.toSortedSet() for easier conversion to sorted setsand collection.notNull() so its easy to treat a nullable collection/list as a collection
This commit is contained in:
@@ -10,4 +10,8 @@ inline fun <T, R> java.util.Collection<T>.map(result: Collection<R> = ArrayList<
|
||||
}
|
||||
|
||||
/** Returns true if the collection is not empty */
|
||||
inline fun <T> java.util.Collection<T>.notEmpty() : Boolean = !this.isEmpty()
|
||||
inline fun <T> java.util.Collection<T>.notEmpty() : Boolean = !this.isEmpty()
|
||||
|
||||
/** Converts the nullable collection into an empty collection if its null */
|
||||
inline fun <T> java.util.Collection<T>?.notNull() : Collection<T>
|
||||
= if (this != null) this else Collections.EMPTY_LIST as Collection<T>
|
||||
|
||||
Reference in New Issue
Block a user