class ExcelFieldService {

    public static Long getObjectID(final Object object) {
        Long objectId = Long.valueOf(-1);

        if (object == null || !(Persistable.class.isAssignableFrom(object.getClass()))) {
            return Long.valueOf(-1);
        }

        try {
            final Method idMethod = object.getClass().getMethod("getId");
            if (idMethod != null) {
                objectId = (Long) idMethod.invoke(object);
            }
        } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
            logger.error("getObjectID error", e);
        }

        return objectId;
    }

    private  ExcelFieldService();

}