Skip to content

Commit

Permalink
Update Dagger to v2.47 (#4811)
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth authored Oct 12, 2023
1 parent 34a5008 commit 03c3b24
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/org/simple/clinic/util/Optional.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import java.util.Optional
* This is the preferred method of obtaining an instance of [Optional] in Kotlin. In Java, prefer
* using the static [Optional.ofNullable] method.
*/
fun <T> T?.toOptional(): Optional<T> = Optional.ofNullable(this)
fun <T> T?.toOptional(): Optional<T> = Optional.ofNullable(this) as Optional<T>

/**
* Converts [Optional] to either its non-null value if it's non-empty or `null` if it's empty.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class MoshiObjectPreferenceConverter<T>(

private val adapter = moshi.adapter(clazz)

override fun deserialize(serialized: String): T {
override fun deserialize(serialized: String): T & Any {
return adapter.fromJson(serialized)!!
}

override fun serialize(value: T): String {
override fun serialize(value: T & Any): String {
return adapter.toJson(value)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class OptionalRxPreferencesConverter<T>(private val valueConverter: Preference.C

override fun deserialize(serialized: String): Optional<T> {
return when {
serialized.isEmpty() -> Optional.empty()
else -> Optional.of(valueConverter.deserialize(serialized))
serialized.isEmpty() -> Optional.empty<T>() as Optional<T>
else -> Optional.of<T>(valueConverter.deserialize(serialized)) as Optional<T>
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import java.util.Optional
fun <T> RxSharedPreferences.getOptional(
key: String,
converter: Preference.Converter<T>,
defaultValue: Optional<T> = Optional.empty()
defaultValue: Optional<T> = Optional.empty<T>() as Optional<T>
): Preference<Optional<T>> {
return getObject(key, defaultValue, OptionalRxPreferencesConverter(converter))
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ androidx-room = "2.4.3"
androidx-work = "2.7.1"
androidx-security-crypto = "1.1.0-alpha06"

dagger = "2.44.2"
dagger = "2.47"

flipper = "0.176.0"

Expand Down

0 comments on commit 03c3b24

Please sign in to comment.