Same as {@linkplain ConvertUtil#toInteger(Object)} but does not throw an exception
if the conversion could not be done.

@param value
@param defaultValue
@return
768165
public static Integer toInteger(Object value, Integer defaultValue) {
        try {
            return toInteger(value);
        } catch (Exception e) {
            return defaultValue;
        }
    }
922534
public static int getInt(@NotNull ServletRequest request, @NotNull String param, int defaultValue) {
    String value = request.getParameter(param);
    return NumberUtils.toInt(value, defaultValue);
  }
804317
public static Integer toInteger(Object o, Integer defaultValue) {
	if (defaultValue != null) return Integer.valueOf(toIntValue(o, defaultValue.intValue()));
	int res = toIntValue(o, Integer.MIN_VALUE);
	if (res == Integer.MIN_VALUE) return defaultValue;
	return Integer.valueOf(res);
    }
841110
@Pure
	@Inline(value = "$2.valueOf($1.intValue())", imported = Integer.class)
	public static Integer toInteger(AtomicDouble number) {
		return Integer.valueOf(number.intValue());
	}
293784
private static int configurationInteger(Properties properties, String key, int defaultValue)
   {
      if (properties != null)
      {
         if (properties.containsKey(key))
            return Integer.valueOf(properties.getProperty(key));
      }

      return defaultValue;
   }
465345
function toInteger(value) {
    value = +value;
    return value === 0 || !isFinite(value) ? value || 0 : value - (value % 1);
  }
215290
public static int defaultIfNotInteger(String _possibleInt, int _default) {
       if (isInteger(_possibleInt)) {
           return Integer.parseInt(_possibleInt);
       }
       return _default;
   }
1083232
@Nullable
	public static Integer valueOrPropertyAsInteger(@Nullable final Integer value, @Nonnull final Property property, @Nullable final Integer defaultValue) {
		return SimpleConversions.convertToInteger(valueOrProperty(value, property, defaultValue));
	}
1172960
private static int toInt(String str, int defaultVal) {
    try {
      return Integer.parseInt(str.trim());
    } catch (Exception e) {
      return defaultVal;
    }
  }
687799
@CheckResult @NonNull
  public Preference<Integer> getInteger(@NonNull String key, @NonNull Integer defaultValue) {
    checkNotNull(key, "key == null");
    checkNotNull(defaultValue, "defaultValue == null");
    return new RealPreference<>(preferences, key, defaultValue, IntegerAdapter.INSTANCE, keyChanges);
  }
269062
public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) {
		return convert(BigDecimal.class, value, defaultValue);
	}
625040
public static int getInt(JsonObject object, String field, int defaultValue) {
        final JsonValue value = object.get(field);
        if (value == null || value.isNull()) {
            return defaultValue;
        } else {
            return value.asInt();
        }
    }
273894
public static Long getValue(final Long value, final Long defaultValue) {

    return value == null ? defaultValue : value;
  }
158861
public static boolean isIntValue(final String value) {
        try {
            Integer.parseInt(value);
            return true;
        } catch (final NumberFormatException ex) {
            return false;
        }
    }
170407
public static Integer readInteger(String value, Integer defaultValue) {
		if (!StringUtils.hasText(value)) return defaultValue;
		
		return Integer.valueOf(value);
	}
403904
public static Number toNumber(Object value, Number defaultValue) {
		return convert(Number.class, value, defaultValue);
	}
938624
public int getInteger( String key, int defaultValue )
        throws MissingResourceException
    {
        try
        {
            return getInteger( key );
        }
        catch( MissingResourceException mre )
        {
            return defaultValue;
        }
    }