Neither of the two pages, the one on Interfaces, nor the one on Visibility Modifiers provides an example of the syntax I am after, so I ask.
I have an interface like so:
package bookyard.contracts;
public interface IAuthenticationManager<T> {
fun authenticateUser(userName: String, password : String,
appId: String, appSecret : String) : OperationResult<T>;
}
And I am writing an implementation for it but neither of the three below listed syntaxes work. Each time, the compiler reports the following error:
'authenticateUser' overrides nothing
Class 'DatabaseAuthenticationManager' must be declared abstract or implement abstract member public abstract fun authenticateUser(userName: String, password: String, appId: String, appSecret: String): OperationResult defined in bookyard.contracts.IAuthenticationManager
package bookyard.server.util
import bookyard.contracts.IAuthenticationManager;
public class DatabaseAuthenticationManager : IAuthenticationManager<User> {
/* override public fun authenticateUser(userName : String?,
password : String?,
appId : String?,
appSecret : String?) : OperationResult<User> {
}
public override fun authenticateUser(userName : String?,
password : String?,
appId : String?,
appSecret : String?) : OperationResult<User> {
}
public fun authenticateUser(userName : String?,
password : String?,
appId : String?,
appSecret : String?) : OperationResult<User> {
} */
}
String?
instead ofString
as the data type for a lot of the parameters. They aren't interchangeable. You can make your interface use nullable Strings and it won't complain about the signature. – byxor