]> source.dussan.org Git - poi.git/commitdiff
make hyperlink duplicatable
authorPJ Fanning <fanningpj@apache.org>
Sun, 19 Sep 2021 22:39:19 +0000 (22:39 +0000)
committerPJ Fanning <fanningpj@apache.org>
Sun, 19 Sep 2021 22:39:19 +0000 (22:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1893457 13f79535-47bb-0310-9956-ffa450edef68

poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFHyperlink.java

index 348ca4723e9fbba0f6ac0ff0d52dc329bcf95f4b..e145a5e89a734fc0b8d2a8bd4b42632d97407f7f 100644 (file)
@@ -16,6 +16,7 @@
 ==================================================================== */
 package org.apache.poi.hssf.usermodel;
 
+import org.apache.poi.common.Duplicatable;
 import org.apache.poi.common.usermodel.HyperlinkType;
 import org.apache.poi.hssf.record.HyperlinkRecord;
 import org.apache.poi.ss.usermodel.Hyperlink;
@@ -24,7 +25,7 @@ import org.apache.poi.util.Internal;
 /**
  * Represents an Excel hyperlink.
  */
-public class HSSFHyperlink implements Hyperlink {
+public class HSSFHyperlink implements Hyperlink, Duplicatable {
 
     /**
      * Low-level record object that stores the actual hyperlink data
@@ -261,6 +262,15 @@ public class HSSFHyperlink implements Hyperlink {
         return link_type;
     }
 
+    /**
+     * @return a new HSSFHyperlink based on this
+     * @since POI 5.1.0
+     */
+    @Override
+    public Duplicatable copy() {
+        return new HSSFHyperlink(this);
+    }
+
     /**
      * @return whether the objects have the same HyperlinkRecord
      */