public static final Integer getInteger(Object value, Integer defaultValue) {
		if (value == null) {
			return defaultValue;
		}
		if (value instanceof Number) {
			return value.getClass() == Integer.class ? (Integer) value : ((Number) value).intValue();
		} else if (value instanceof CharSequence && ((CharSequence) value).length() == 0) {
			return defaultValue;
		} else {
			try {
				return Integer.valueOf(value.toString());
			} catch (Exception e) {
				return defaultValue;
			}
		}
	}