make hyperlink duplicatable

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1893457 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2021-09-19 22:39:19 +00:00
parent f44deb0829
commit b377d66318
1 changed files with 11 additions and 1 deletions

View 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
*/