From 15dc1f9e50fa1c0b07e8e2bcc98a6c6b2b555e1d Mon Sep 17 00:00:00 2001 From: jomu Date: Fri, 25 Jan 2019 17:42:09 +0100 Subject: [PATCH] added PoiUtil class --- .../de/muehlencord/shared/poi/PoiUtil.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 poi-util/src/main/java/de/muehlencord/shared/poi/PoiUtil.java diff --git a/poi-util/src/main/java/de/muehlencord/shared/poi/PoiUtil.java b/poi-util/src/main/java/de/muehlencord/shared/poi/PoiUtil.java new file mode 100644 index 0000000..1898de4 --- /dev/null +++ b/poi-util/src/main/java/de/muehlencord/shared/poi/PoiUtil.java @@ -0,0 +1,44 @@ +/* + * Copyright 2019 Joern Muehlencord (joern (at) muehlencord.de) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.muehlencord.shared.poi; + +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; + +/** + * + * @author Joern Muehlencord (joern (at) muehlencord.de) + */ +public abstract class PoiUtil { + + private PoiUtil() { + // hide constructor of abstract classes + } + + public static boolean cellEmpty(Cell cell) { + if (cell == null) + return true; + if (cell.getCellType() == CellType.BLANK) + return true; + if (cell.getCellType() == CellType.STRING) { + return cell.getStringCellValue().equals (""); + } + return false; + } + + + +}