/** * Returns the String array values as a long array. If the values array is * <code>null</code>, the {@link #DEFAULT_LONG_VALUES} array is returned. In * the returned array, each value element not convertible to a long is * replaced by the {@link #DEFAULT_LONG}. * * @param values the values to convert * @return the values as a long array */ public static long[] getLongValues(String[] values) { return getLongValues(values, DEFAULT_LONG_VALUES); }
/** * Returns the Object value as a long array. If the value is * <code>null</code>, the {@link #DEFAULT_LONG_VALUES} array is returned. In * the returned array, each value element not convertible to a long is * replaced by the {@link #DEFAULT_LONG}. * * @param value the value to convert * @return the value as a long array */ public static long[] getLongValues(Object value) { return getLongValues(value, DEFAULT_LONG_VALUES); }
public long[] getLongValues(java.lang.String[] values, long[] defaultValue) { return GetterUtil.getLongValues(values, defaultValue); }
public long[] getLongValues(java.lang.Object value, long[] defaultValue) { return GetterUtil.getLongValues(value, defaultValue); }
public long[] getLongValues(java.lang.Object value) { return GetterUtil.getLongValues(value); }
public long[] getLongValues(java.lang.String[] values) { return GetterUtil.getLongValues(values); }
/** * Returns the Object value as a long array. If the value is * <code>null</code>, the default value is returned. In the returned array, * each value element not convertible to a long is replaced by the {@link * #DEFAULT_LONG}. * * @param value the value to convert * @param defaultValue a default value * @return the value as a long array */ public static long[] getLongValues(Object value, long[] defaultValue) { if (value instanceof String[]) { return getLongValues((String[])value, defaultValue); } if (value instanceof long[]) { return (long[])value; } if (value instanceof Number[]) { Number[] numbers = (Number[])value; long[] values = new long[numbers.length]; for (int i = 0; i < values.length; i++) { values[i] = numbers[i].longValue(); } return values; } return defaultValue; }
/** * Returns the portlet request parameter value as a long array. In the * returned array, each parameter value not convertible to a long is * replaced by the default value. * * @param portletRequest the portlet request from which to read the * parameter * @param param the name of the parameter * @param defaultValue a default value * @return the portlet request parameter value as a long array */ public static long[] getLongValues( PortletRequest portletRequest, String param, long[] defaultValue) { return GetterUtil.getLongValues( getParameterValues(portletRequest, param, null), defaultValue); }
/** * Returns the service context parameter value as a long array. In the * returned array, each parameter value not convertible to a long is * replaced by the default value. * * @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 array */ public static long[] getLongValues( ServiceContext serviceContext, String param, long[] defaultValue) { return GetterUtil.getLongValues( serviceContext.getAttribute(param), defaultValue); }
/** * Returns the request parameter value as a long array. In the returned * array, each parameter value not convertible to a long is replaced by the * default value. * * @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 long array */ public static long[] getLongValues( HttpServletRequest request, String param, long[] defaultValue) { return GetterUtil.getLongValues( getParameterValues(request, param, null), defaultValue); }
public static long[] getLongValues(String[] values) { return getLongValues(values, DEFAULT_LONG_VALUES); }
public long[] getLongValues(java.lang.String[] values) { return GetterUtil.getLongValues(values); }
public long[] getLongValues(java.lang.String[] values, long[] defaultValue) { return GetterUtil.getLongValues(values, defaultValue); }
public static long[] getLongValues( HttpServletRequest request, String param, long[] defaultValue) { return GetterUtil.getLongValues( request.getParameterValues(param), defaultValue); }
public static long[] getLongValues( PortletRequest portletRequest, String param, long[] defaultValue) { return GetterUtil.getLongValues( portletRequest.getParameterValues(param), defaultValue); }
public long[] getClassTypeIds() { if (_classTypeIds != null) { return _classTypeIds; } _classTypeIds = GetterUtil.getLongValues( _portletPreferences.getValues("classTypeIds", null)); return _classTypeIds; }
@Override public BackgroundTaskResult execute(BackgroundTask backgroundTask) throws Exception { Map<String, Serializable> taskContextMap = backgroundTask.getTaskContextMap(); String className = (String)taskContextMap.get( ReindexBackgroundTaskConstants.CLASS_NAME); long[] companyIds = GetterUtil.getLongValues( taskContextMap.get(ReindexBackgroundTaskConstants.COMPANY_IDS)); reindex(className, companyIds); return BackgroundTaskResult.SUCCESS; }
return GetterUtil.getLongValues(attribute);
return GetterUtil.getLongValues(StringUtil.split(attribute));
protected void setPhaseAttributes( BackgroundTaskStatus backgroundTaskStatus, Message message) { backgroundTaskStatus.setAttribute( ReindexBackgroundTaskConstants.COMPANY_ID, message.getLong(ReindexBackgroundTaskConstants.COMPANY_ID)); backgroundTaskStatus.setAttribute( ReindexBackgroundTaskConstants.COMPANY_IDS, GetterUtil.getLongValues( message.get(ReindexBackgroundTaskConstants.COMPANY_IDS))); backgroundTaskStatus.setAttribute( ReindexBackgroundTaskConstants.PHASE, message.getString(ReindexBackgroundTaskConstants.PHASE)); }