]> source.dussan.org Git - poi.git/commitdiff
bug 59873: add @Internal and @Deprecated decorators to HyperlinkType enum
authorJaven O'Neal <onealj@apache.org>
Sun, 17 Jul 2016 11:56:13 +0000 (11:56 +0000)
committerJaven O'Neal <onealj@apache.org>
Sun, 17 Jul 2016 11:56:13 +0000 (11:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1753062 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/common/usermodel/HyperlinkType.java
src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java

index 0d8e139c870985b5774d72239ae9169e4a52a1ed..dc88dc560899039f3bbeb3e0b6b42c49699adb79 100644 (file)
@@ -49,7 +49,23 @@ public enum HyperlinkType {
      */
     FILE(4);
     
+    
+    /** @deprecated POI 3.15 beta 3 */
+    @Internal(since="3.15 beta 3")
+    @Deprecated
     private final int code;
+    
+    /**
+     * The codes don't have any real meaning.
+     * There bytes that are read in and written out from HSSF, HSLF, XSSF, and XSLF are different
+     * that the codes here.
+     * These codes only exist to assist in transitioning from using ints to enums.
+     *
+     * @param code
+     * @deprecated POI 3.15 beta 3
+     */
+    @Internal(since="3.15 beta 3")
+    @Deprecated
     private HyperlinkType(int code) {
         this.code = code;
     }
@@ -61,10 +77,26 @@ public enum HyperlinkType {
         }
     }
     
+    /**
+     * @deprecated POI 3.15 beta 3
+     *
+     * @return the old integer code for a HyperlinkType enum
+     */
+    @Internal(since="3.15 beta 3")
+    @Deprecated
     public int getCode() {
         return code;
     }
     
+    /**
+     * @deprecated POI 3.15 beta 3
+     *
+     * @param code the old integer code
+     * @return the corresponding HyperlinkEnum, if it exists
+     * @throws IllegalArgumentException if {@code code} is not a valid HyperlinkType.
+     */
+    @Internal(since="3.15 beta 3")
+    @Deprecated
     public static HyperlinkType forInt(int code) {
         HyperlinkType type = map.get(code);
         if (type == null) {
index c519e165a833c9fa9a0c41e64e699b300d992336..ed0c1da7e49be95c0cfc45d5ec81bac1c3752a24 100644 (file)
@@ -213,7 +213,9 @@ public class BaseTestCellUtil {
      * @deprecated by {@link #setAlignmentEnum()}\r
      *\r
      * @throws IOException\r
+     * \r
      */\r
+    @SuppressWarnings("deprecated")\r
     @Test\r
     public void setAlignment() throws IOException {\r
         Workbook wb = _testDataProvider.createWorkbook();\r