contrib/jwrapper: make casting base objects (Integer, Long, etc.) optional