Made a proper java cursor to convert scala types into py4j compatible java types