Reliably convert any object to String and then back again

后端 未结 7 777
名媛妹妹
名媛妹妹 2020-12-02 13:35

Is there a reliable way to convert any object to a String and then back again to the same Object? I\'ve seen some examples of people converting them using toString()

7条回答
  •  执笔经年
    2020-12-02 13:52

    You can use SerializationUtils from org.apache.commons.
    It provides the methods serialize and deserialize

提交回复
热议问题