question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make `Call.Factory` a function interface in Kotlin 1.4

See original GitHub issue

Feature request that I wanted to file for the future.

fun interface Factory {
  fun newCall(request: Request): Call
}

Then it could be used as a lambda with 1.4’s SAM support

Retrofit.Builder()
  .callFactory { ... }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

[Solved]-Function interface in Kotlin 1.4-kotlin - appsloveworld
This is about functional interfaces — interfaces with a Single Abstract Method (also called SAM interfaces). To understand the point, I'll need to...
Read more >
Functional (SAM) interfaces - Kotlin
An interface with only one abstract method is called a functional interface, or a Single Abstract Method (SAM) interface.
Read more >
How to implement a functional interface as lambda in Kotlin?
In Kotlin an functional / SAM interface is considered as an anti-pattern, a function type should be declared instead: (String)->String .
Read more >
The Interconnection of Functional Interfaces in Java and Kotlin
To declare a Functional interface in Java is easy. You just create a normal interface with one method for example. ... And in...
Read more >
Kotlin Factory Method - DevLog | Adam Świderski
Instead of calling object constructor, we can call a method of the Factory which will generate interface implementation - the concrete object.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found