java pattern to convert one object to another java convert double to string journaldev