mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
removing noisy log which duplicates a type clause and fixing when casing formatting to have a case per line
This commit is contained in:
parent
e7a0a4d4ae
commit
7b356484ae
1 changed files with 7 additions and 9 deletions
|
@ -22,7 +22,6 @@ import io.realm.RealmQuery
|
|||
import org.matrix.android.sdk.api.query.QueryStringValue
|
||||
import org.matrix.android.sdk.api.query.QueryStringValue.ContentQueryStringValue
|
||||
import org.matrix.android.sdk.internal.util.Normalizer
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
class QueryStringValueProcessor @Inject constructor(
|
||||
|
@ -31,10 +30,7 @@ class QueryStringValueProcessor @Inject constructor(
|
|||
|
||||
fun <T : RealmObject> RealmQuery<T>.process(field: String, queryStringValue: QueryStringValue): RealmQuery<T> {
|
||||
return when (queryStringValue) {
|
||||
is QueryStringValue.NoCondition -> {
|
||||
Timber.v("No condition to process")
|
||||
this
|
||||
}
|
||||
is QueryStringValue.NoCondition -> this
|
||||
is QueryStringValue.IsNotNull -> isNotNull(field)
|
||||
is QueryStringValue.IsNull -> isNull(field)
|
||||
is QueryStringValue.IsEmpty -> isEmpty(field)
|
||||
|
@ -48,15 +44,17 @@ class QueryStringValueProcessor @Inject constructor(
|
|||
|
||||
private fun ContentQueryStringValue.toRealmValue(): String {
|
||||
return when (case) {
|
||||
QueryStringValue.Case.NORMALIZED -> normalizer.normalize(string)
|
||||
QueryStringValue.Case.SENSITIVE, QueryStringValue.Case.INSENSITIVE -> string
|
||||
QueryStringValue.Case.NORMALIZED -> normalizer.normalize(string)
|
||||
QueryStringValue.Case.SENSITIVE,
|
||||
QueryStringValue.Case.INSENSITIVE -> string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun QueryStringValue.Case.toRealmCase(): Case {
|
||||
return when (this) {
|
||||
QueryStringValue.Case.INSENSITIVE -> Case.INSENSITIVE
|
||||
QueryStringValue.Case.SENSITIVE, QueryStringValue.Case.NORMALIZED -> Case.SENSITIVE
|
||||
QueryStringValue.Case.INSENSITIVE -> Case.INSENSITIVE
|
||||
QueryStringValue.Case.SENSITIVE,
|
||||
QueryStringValue.Case.NORMALIZED -> Case.SENSITIVE
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue