Commit 526a0b92 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

unused class removed

parent 816aadd2
package lcsb.mapviewer.api;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import lcsb.mapviewer.services.QueryException;
public class SerializationUtils {
private static Logger logger = LogManager.getLogger();
public static Integer parseInteger(Object value, String fieldName) throws QueryException {
if (value instanceof Integer) {
return (Integer) value;
} else if (value instanceof Double) {
logger.warn("Double will be trunceted to int: " + value);
return ((Double) value).intValue();
} else if (value == null) {
return null;
} else if (value instanceof String) {
if (((String) value).equalsIgnoreCase("")) {
return null;
} else {
try {
return Integer.parseInt((String) value);
} catch (NumberFormatException e) {
throw new QueryException("Invalid " + fieldName + " value: " + value);
}
}
} else {
throw new QueryException("Invalid " + fieldName + " value: " + value);
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment