com.atlassian.jira.util
Class ParameterUtils

java.lang.Object
  extended bycom.atlassian.jira.util.ParameterUtils

public class ParameterUtils
extends java.lang.Object


Constructor Summary
ParameterUtils()
           
 
Method Summary
static java.util.Date getDateParam(java.util.Map params, java.lang.String s, java.util.Locale locale)
           
static java.lang.String getDateParam(SearchRequest searchRequest, java.lang.String name, java.util.Locale locale)
           
static java.lang.Double getDoubleParam(java.util.Map params, java.lang.String key)
           
static java.util.Collection getIdsFromCollection(java.util.Collection entities)
          Given a collection of entities, return a Collection representing the IDs
static java.util.List getListFromStringArray(java.lang.String[] ar)
           
static java.util.List getListParam(java.util.Map params, java.lang.String key)
          Create a List from the parameter with the specified key.
static java.util.List getListParamKeepMinusOnes(java.util.Map params, java.lang.String key)
           
static java.util.List getLongListFromStringArray(java.lang.String[] ar)
          Given an array of Strings, return a list of Longs representing the IDs
static java.lang.Long getLongParam(java.util.Map params, java.lang.String key)
           
static java.lang.Long getPreviousParam(SearchRequest searchRequest, java.lang.String name)
          Get the period, and then try to work out approximately what they meant (because the period is constantly changing this is not exact but should work most - all? - of the time)
static java.lang.String getSingleFilterParam(SearchRequest searchRequest, java.lang.String name)
           
static java.lang.String getSRQueryString(IssueNavigator issueNavigator)
          This method returns a query string representing the current search request
static java.lang.String[] getStringArrayFromList(java.util.Collection entities)
          Given a collection of entities, return an array of Strings representing the IDs
static java.lang.String getStringParam(java.util.Map params, java.lang.String key)
           
static User getUserParam(java.util.Map params, java.lang.String s)
           
static java.util.List makeListLong(java.util.List list)
          Make a list of Strings into a list of Longs
static java.util.Collection swapNulls(java.util.Collection col)
          Convert all null values in a collection into "-1"s.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterUtils

public ParameterUtils()
Method Detail

getDateParam

public static java.util.Date getDateParam(java.util.Map params,
                                          java.lang.String s,
                                          java.util.Locale locale)

getUserParam

public static User getUserParam(java.util.Map params,
                                java.lang.String s)

getListParam

public static java.util.List getListParam(java.util.Map params,
                                          java.lang.String key)
Create a List from the parameter with the specified key.

Parameters:
params -
key -
Returns:
null if the object is not a String array, or has no elements
otherwise it returns a List containing all elements of the String array, with the Strings over value ("-1") turned into null's. (Strings with value "" are ignored).

getListParamKeepMinusOnes

public static java.util.List getListParamKeepMinusOnes(java.util.Map params,
                                                       java.lang.String key)

makeListLong

public static java.util.List makeListLong(java.util.List list)
Make a list of Strings into a list of Longs


getStringParam

public static java.lang.String getStringParam(java.util.Map params,
                                              java.lang.String key)

getLongParam

public static java.lang.Long getLongParam(java.util.Map params,
                                          java.lang.String key)

getDoubleParam

public static java.lang.Double getDoubleParam(java.util.Map params,
                                              java.lang.String key)

swapNulls

public static java.util.Collection swapNulls(java.util.Collection col)
Convert all null values in a collection into "-1"s.


getSingleFilterParam

public static java.lang.String getSingleFilterParam(SearchRequest searchRequest,
                                                    java.lang.String name)

getDateParam

public static java.lang.String getDateParam(SearchRequest searchRequest,
                                            java.lang.String name,
                                            java.util.Locale locale)

getPreviousParam

public static java.lang.Long getPreviousParam(SearchRequest searchRequest,
                                              java.lang.String name)
Get the period, and then try to work out approximately what they meant (because the period is constantly changing this is not exact but should work most - all? - of the time)


getLongListFromStringArray

public static java.util.List getLongListFromStringArray(java.lang.String[] ar)
Given an array of Strings, return a list of Longs representing the IDs


getListFromStringArray

public static java.util.List getListFromStringArray(java.lang.String[] ar)

getStringArrayFromList

public static java.lang.String[] getStringArrayFromList(java.util.Collection entities)
Given a collection of entities, return an array of Strings representing the IDs


getIdsFromCollection

public static java.util.Collection getIdsFromCollection(java.util.Collection entities)
Given a collection of entities, return a Collection representing the IDs


getSRQueryString

public static java.lang.String getSRQueryString(IssueNavigator issueNavigator)
This method returns a query string representing the current search request