I'm new to kotlin and I'm trying to develop a gradle plugin.
The parameter name confuses me when I implement a Java function interface called org.gradle.api.Action.
My code.
val action: Action<AppliedPlugin> = Action { // Tip from IDEA "this:AppliedPlugin"
}
The function interface in Java.
public interface Action<T> {
/**
* Performs this action against the given object.
*
* @param t The object to perform the action on.
*/
void execute(T t);
}
I'm confused by the tip, because I think parameter's default name is it not this.
Then I declared another Java function interface and implemented it. This time tip is it:AppliedPlugin!. Here is my code and temp function interface.
val temp: Temp<AppliedPlugin> = Temp { // Tip from IDEA "it:AppliedPlugin!"
}
public interface Temp<T> {
void test(T t);
}
Can someone explain why kotlin use this as the default parameter name in the first lambda?