mirror of
https://github.com/square/okhttp.git
synced 2025-11-29 06:23:09 +03:00
Deprecate SAM conversion methods
This commit is contained in:
@@ -109,11 +109,11 @@ class HttpLoggingInterceptor @JvmOverloads constructor(
|
||||
fun log(message: String)
|
||||
|
||||
companion object {
|
||||
// This lambda conversion is for Kotlin callers expecting a Java SAM (single-abstract-method).
|
||||
@JvmName("-deprecated_Logger")
|
||||
inline operator fun invoke(
|
||||
crossinline block: (message: String) -> Unit
|
||||
): Logger = object : Logger {
|
||||
@Deprecated(
|
||||
message = "No SAM (single-abstract-method) conversions for Kotlin declarations",
|
||||
level = DeprecationLevel.WARNING)
|
||||
operator fun invoke(block: (message: String) -> Unit): Logger = object : Logger {
|
||||
override fun log(message: String) = block(message)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user