In general, this is a pain working with raw types in java code from Scala.
Try the following:
public interface Function extends Identifiable<String> { public String getId(); }
The error is probably due to the inability of the compiler to determine the type of T , since the type is not mentioned in the declaration of Function extends Identifiable . This is due to an error:
: 17: error: getId override method in the attribute Identifies type () T; getId method has incompatible type
Scala is made compatible with Java 1.5 and later. For previous versions you need to hack. If you cannot change the Adapter , you can create a Scala shell in Java:
public abstract class ScalaAdapter extends Adapter { @Override public String getId() {
And then use this in Scala:
scala> class Multi extends ScalaAdapter { | def getScalaId():String = "!2" | } defined class Multi
source share