I am trying to filter the list on the basis of it\'s property. For example, Sensors class has a property isActive
and I want to get all the objects with isAct
I wanted to delete the values of a list based on Rejex and finally return a Observable list model
fun getList(): Observable> {
return appDataBase.dao().getAllList().flatMap {
Observable.fromIterable(it).filter { destination ->
destination.number.matches(regex = "[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]*\$".toRegex())
}.toList().toObservable()
}.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
}
I hope this helps