Problem with generic classes using Java Gateway
Hello,
Currently, I'm working with a Java Gateway, and I have the following problem. When importing a class into IRIS, which uses methods from a generic class, I can not find the general methods I need. I'm talking about the test2 method from the class test. How can I import the java method that returns a generic?
public class Generic<T1, T2> {
T1 object1;
T2 object2;
public Generic(T1 one, T2 two) {
object1 = one;
object2 = two;
}
public T1 getFirst() {
return object1;
}
public T2 getSecond() {
return object2;
}
}
public class Test {
public Test(){
}
public static Generic<String,Integer> test2(){
return new Generic<String, Integer>("hello ", 5);
}
public static String main() {
Generic<Integer, String> pair = new Generic(6, " Apr");
return pair.getFirst() + pair.getSecond();
}
}
Generated class:
Class User.Test Extends java.lang.Object [ ProcedureBlock ]
{
Parameter IMPORTTIMESTAMP As STRING = "2018-08-23 12:42:53.397";
Method %OnNew(ByRef p0 As %ObjectHandle) As %Status
{
Quit:'$D(p0) $$$OK
Quit ..%Constructor(p0,"Test",0)
}
ClassMethod main(ByRef p0 As %ObjectHandle) As %ObjectHandle
{
Quit ..%SR(p0,"main","Test")
}
}
Regards,
Gevorg Arutunyan