/** * Returns the Object value as a double. If the value is <code>null</code> * or not convertible to a double, the default value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as a double */ public static double getDouble(Object value, double defaultValue) { return get(value, defaultValue); }
/** * Returns the String value as a Number. If the value is <code>null</code> * or not convertible to a Number, the default value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as a Number */ public static Number getNumber(String value, Number defaultValue) { return get(value, defaultValue); }
/** * Returns the String value as a double. If the value is <code>null</code> * or not convertible to a double, the default value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as a double */ public static double getDouble(String value, double defaultValue) { return get(value, defaultValue); }
/** * Returns the String value as a short. If the value is <code>null</code> or * not convertible to a short, the default value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as a short */ public static short getShort(String value, short defaultValue) { return get(value, defaultValue); }
/** * Returns the String value. If the value is <code>null</code>, the default * value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value */ public static String getString(String value, String defaultValue) { return get(value, defaultValue); }
public double get(java.lang.String value, double defaultValue, java.util.Locale locale) { return GetterUtil.get(value, defaultValue, locale); }
/** * Returns the String value as a double. If the value is <code>null</code> * or not convertible to a double, the default value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as a double */ public static double get(String value, double defaultValue) { return get(value, defaultValue, null); }
/** * Returns the Object value as an integer. If the value is <code>null</code> * or not convertible to an integer, the default value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as an integer */ public static int getInteger(Object value, int defaultValue) { return get(value, defaultValue); }
/** * Returns the Object value as a long. If the value is <code>null</code> or * not convertible to a long, the default value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as a long */ public static long getLong(Object value, long defaultValue) { return get(value, defaultValue); }
/** * Returns the Object value as a short. If the value is <code>null</code> or * not convertible to a short, the default value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as a short */ public static short getShort(Object value, short defaultValue) { return get(value, defaultValue); }
/** * Returns the Object value as a boolean. If the value is <code>null</code>, * the default value is returned. If the value does not match a {@link * #BOOLEANS} value, <code>false</code> is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as a boolean */ public static boolean getBoolean(Object value, boolean defaultValue) { return get(value, defaultValue); }
/** * Returns the String value as a double. If the value is <code>null</code> * or not convertible to a double, the {@link #DEFAULT_DOUBLE} is returned. * * @param value the value to convert * @param locale the locale used to parse the double value * @return the value as a double */ public static double getDouble(String value, Locale locale) { return get(value, DEFAULT_DOUBLE, locale); }
/** * Returns the Object value as a float. If the value is <code>null</code> or * not convertible to a float, the default value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as a float */ public static float getFloat(Object value, float defaultValue) { return get(value, defaultValue); }
/** * Returns the String value as an integer. If the value is <code>null</code> * or not convertible to an integer, the default value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as an integer */ public static int getInteger(String value, int defaultValue) { return get(value, defaultValue); }
/** * Returns the Object value as a Number. If the value is <code>null</code> * or not convertible to a Number, the default value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as a Number */ public static Number getNumber(Object value, Number defaultValue) { return get(value, defaultValue); }
/** * Returns the String value as a long. If the value is <code>null</code> or * not convertible to a long, the default value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as a long */ public static long getLong(String value, long defaultValue) { return get(value, defaultValue); }
/** * Returns the Object value as a String. If the value is <code>null</code>, * the default value is returned. * * @param value the value to convert * @param defaultValue a default value * @return the value as a String */ public static String getString(Object value, String defaultValue) { return get(value, defaultValue); }
/** * Returns the request parameter value as a double. If the parameter is * missing or not convertible to a double, the default value is returned. * * @param request the servlet request from which to read the parameter * @param param the name of the parameter * @param defaultValue a default value * @return the request parameter value as a double */ public static double get( HttpServletRequest request, String param, double defaultValue) { return GetterUtil.get(request.getParameter(param), defaultValue); }
/** * Returns the service context parameter value as a long. If the parameter * is missing or not convertible to a long, the default value is returned. * * @param serviceContext the service context from which to read the * parameter * @param param the name of the parameter * @param defaultValue a default value * @return the service context parameter value as a long */ public static long get( ServiceContext serviceContext, String param, long defaultValue) { return GetterUtil.get(serviceContext.getAttribute(param), defaultValue); }
private String _getLocalizedValue( Map<Locale, String> localizedValueMap, Locale locale, String defaultValue) { return GetterUtil.get( MapUtil.getWithFallbackKey( localizedValueMap, locale, LocaleUtil.getDefault()), defaultValue); }