added PoiUtil class

This commit is contained in:
2019-01-25 17:42:09 +01:00
parent 825aa6cbf5
commit 15dc1f9e50

View File

@ -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;
}
}