|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.util.ParameterUtils
public class ParameterUtils
This class can be used to "parse" values from a map of parameters. This is really intended to be used in Action
code that needs to read input parameters from ActionContext.getParameters()
Nested Class Summary | |
---|---|
static class |
ParameterUtils.DateTooEarlyException
Deprecated. Only used in deprecated method. Since v5.2. |
Constructor Summary | |
---|---|
ParameterUtils()
|
Method Summary | |
---|---|
static boolean |
getBooleanParam(Map mapOfParameters,
String paramName)
Returns a boolean value from the map of parameters. |
static Date |
getDateParam(Map params,
String s,
Locale locale)
Deprecated. Use DateTimeFormatterFactory instead. Since v5.2. |
static Double |
getDoubleParam(Map params,
String key)
|
static int |
getIntParam(Map mapOfParameters,
String paramName,
int defaultValue)
Gets a int value from the map and uses the defaultValue if the value can be converted. |
static List<String> |
getListFromStringArray(String[] ar)
|
static List |
getListParam(Map params,
String key)
Create a List from the parameter with the specified key. |
static List |
getListParamKeepMinusOnes(Map params,
String key)
|
static List<Long> |
getLongListFromStringArray(String[] ar)
Given an array of Strings, return a list of Longs representing the IDs |
static Long |
getLongParam(Map params,
String key)
|
static String[] |
getStringArrayFromList(Collection entities)
Given a collection of entities, return an array of Strings representing the IDs |
static String[] |
getStringArrayParam(Map params,
String paramName)
Returns the value of the specified parameter name as a String[] |
static String |
getStringParam(Map params,
String key)
|
static String |
getStringParam(Map params,
String targetKey,
String targetValue,
String desiredKey)
Searches through the Map (params) for the given targetKey and targetValue extracting the index (i) and uses this to extract the corresponding index value with the desiredKey. |
static com.atlassian.crowd.embedded.api.User |
getUserParam(Map params,
String s)
|
static String |
makeCommaSeparated(Long[] longs)
|
static List |
makeListLong(List list)
Make a list of Strings into a list of Longs |
static boolean |
paramContains(Map params,
String key,
String value)
Checks if the given key, value pair exists in the given params Map |
static Date |
parseDate(String paramValue,
Locale locale)
Deprecated. Use DateTimeFormatterFactory instead. Since v5.2. |
static Collection |
swapNulls(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 |
---|
public ParameterUtils()
Method Detail |
---|
public static Date getDateParam(Map params, String s, Locale locale) throws ParameterUtils.DateTooEarlyException
DateTimeFormatterFactory
instead. Since v5.2.
ParameterUtils.DateTooEarlyException
public static Date parseDate(String paramValue, Locale locale)
DateTimeFormatterFactory
instead. Since v5.2.
public static com.atlassian.crowd.embedded.api.User getUserParam(Map params, String s)
public static List getListParam(Map params, String key)
public static List getListParamKeepMinusOnes(Map params, String key)
public static List makeListLong(List list)
public static String getStringParam(Map params, String key)
public static String[] getStringArrayParam(Map params, String paramName)
params
- the map of parametersparamName
- the name of the parameter
public static String getStringParam(Map params, String targetKey, String targetValue, String desiredKey)
public static boolean paramContains(Map params, String key, String value)
params
- the map of web parameterskey
- the name of the parameter to checkvalue
- the value to check for
public static Long getLongParam(Map params, String key)
public static int getIntParam(Map mapOfParameters, String paramName, int defaultValue)
mapOfParameters
- the map of parametersparamName
- the parameter name to usedefaultValue
- the default value in case things cant be converted
public static boolean getBooleanParam(Map mapOfParameters, String paramName)
mapOfParameters
- the map of parametersparamName
- the parameter name to use
public static Double getDoubleParam(Map params, String key)
public static Collection swapNulls(Collection col)
public static List<Long> getLongListFromStringArray(String[] ar)
public static List<String> getListFromStringArray(String[] ar)
public static String[] getStringArrayFromList(Collection entities)
public static String makeCommaSeparated(Long[] longs)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |