From aadd45c22e34e21f13c194b57a3214b8dfa2bea7 Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Mon, 30 Nov 2015 04:24:06 +0000 Subject: [PATCH] bug 58671: change MissingCellPolicy from class to enum git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1717157 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/ss/usermodel/Row.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/java/org/apache/poi/ss/usermodel/Row.java b/src/java/org/apache/poi/ss/usermodel/Row.java index db9fb3e4fc..f3ea9c9c1a 100644 --- a/src/java/org/apache/poi/ss/usermodel/Row.java +++ b/src/java/org/apache/poi/ss/usermodel/Row.java @@ -221,19 +221,23 @@ public interface Row extends Iterable { * Used to specify the different possible policies * if for the case of null and blank cells */ - public static final class MissingCellPolicy { - private static int NEXT_ID = 1; + public static enum MissingCellPolicy { + RETURN_NULL_AND_BLANK(), + RETURN_BLANK_AS_NULL(), + CREATE_NULL_AS_BLANK(); + + private int NEXT_ID = 1; public final int id; private MissingCellPolicy() { this.id = NEXT_ID++; } } /** Missing cells are returned as null, Blank cells are returned as normal */ - public static final MissingCellPolicy RETURN_NULL_AND_BLANK = new MissingCellPolicy(); - /** Missing cells are returned as null, as are blank cells */ - public static final MissingCellPolicy RETURN_BLANK_AS_NULL = new MissingCellPolicy(); + public static final MissingCellPolicy RETURN_NULL_AND_BLANK = MissingCellPolicy.RETURN_NULL_AND_BLANK; + /** Missing cells and blank cells are returned as null */ + public static final MissingCellPolicy RETURN_BLANK_AS_NULL = MissingCellPolicy.RETURN_BLANK_AS_NULL; /** A new, blank cell is created for missing cells. Blank cells are returned as normal */ - public static final MissingCellPolicy CREATE_NULL_AS_BLANK = new MissingCellPolicy(); + public static final MissingCellPolicy CREATE_NULL_AS_BLANK = MissingCellPolicy.CREATE_NULL_AS_BLANK; /** * Returns the rows outline level. Increased as you -- 2.39.5