how to convert string to object in java