<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kaiseh</author_name>
  <author_url>https://blog.hatena.ne.jp/kaiseh/</author_url>
  <blog_title>kaisehのブログ</blog_title>
  <blog_url>https://kaiseh.hatenadiary.org/</blog_url>
  <categories>
    <anon>Java</anon>
  </categories>
  <description>XStreamで書き出し→読み込みすれば、どんなオブジェクトでもディープコピーできるんだなあ。 import com.thoughtworks.xstream.XStream; public class CopyUtils { public static &lt;T&gt; T deepCopy(T obj) { XStream xs = new XStream(); return (T) xs.fromXML(xs.toXML(obj)); } } XStreamなら、対象のオブジェクトがSerializableを実装していなくても書き出せるのがポイントですね。</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkaiseh.hatenadiary.org%2Fentry%2F20080708%2F1215489354&quot; title=&quot; XStreamを利用して簡単にディープコピー - kaisehのブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-07-08 12:55:54</published>
  <title> XStreamを利用して簡単にディープコピー</title>
  <type>rich</type>
  <url>https://kaiseh.hatenadiary.org/entry/20080708/1215489354</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
