Serial to java class