I was trying to implement Github Link library in my java project. And I don't want to use Kotlin in my project, so I was custom coding the whole library into Java. Any help appreciated. It's hard to convert Kotlin to Java rather the opposite. I have worked with decompiling Kotlin Bytecode, which somewhat helps you to convert it into Java. And that's where it's getting confusing where Function0 and Function1 comes into picture. I also saw this Question on Stackoverflow. But I can't use Kotlin in my project.
Asked
Active
Viewed 2,730 times
0
-
Why you convert it to java? You can use the `Library` in your Java code. – Md. Asaduzzaman Nov 15 '19 at 20:31
-
1Does this answer your question? [What is java equivalent of Kotlin's Function Types?](https://stackoverflow.com/questions/47050723/what-is-java-equivalent-of-kotlins-function-types) – Bö macht Blau Nov 15 '19 at 20:39
-
@Md.Asaduzzaman Its not a personal project. Can't use libraries. And want same animation for bottom nav bar – Darpal Nov 15 '19 at 20:48
-
@0X0nosugar No it didnt. Actually cant use any Kotlin library or any code into my project. Considering the project as a company task. But thanks for the sharing it. I saw that question before – Darpal Nov 15 '19 at 20:51
1 Answers
1
The equivalent are the Functional Interfaces Supplier
and Function
, respectively
They have the same signatures, and are SAM (Single abstract methods), so they are replaceable by an in-line lambda.
https://www.baeldung.com/java-8-functional-interfaces#Suppliers https://www.baeldung.com/java-8-functional-interfaces#Functions

wakingrufus
- 385
- 1
- 3
- 10