I have some java code which defines two classes as follows
public class Foo{
/*Some code here*/
private final Bar b = new Bar(); //Object of inner class.
final class Bar{
/*Some code here*/
}
@Override
public Class<? extends SomeClass> getSerializedClass(){
return Bar.class;
}
}
Now I want pass the type of inner class Bar to some other code in Scala.
trait Trait1 {
def func1[B](path: String, overwrite:Boolean= false, value:Int ) = {
val converter = new OutputConverter[A, Bar, B] (K,V)
Sink[A, B](path, converter, overwrite)
}
case class Sink[K, B](path: String,
outputConverter: OutputConverter[A, Bar, B],
overwrite: Boolean = false) extends DataSink[A, Bar, B] with SinkSource {
/**Some code here*/
}
The difficulty is that I cannot change the Java code. Can anyone please tell me a method to it?
Baris declared protected in the Java code. Passing it outside to another class, in Java or some other language is cause for concern. You may be best served to copy what you need out of Bar and pass that.