public class ParameterUtils extends Object
Action
code that needs to read input parameters from ActionContext.getParameters()
Modifier and Type | Class and Description |
---|---|
static class |
ParameterUtils.DateTooEarlyException
Deprecated.
Only used in deprecated method. Since v5.2.
|
Constructor and Description |
---|
ParameterUtils() |
Modifier and Type | Method and Description |
---|---|
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 ApplicationUser |
getUserParam(Map params,
String s) |
static String |
makeCommaSeparated(Long[] longs) |
static List<Long> |
makeListLong(List<String> 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.
|
public static Date getDateParam(Map params, String s, Locale locale) throws ParameterUtils.DateTooEarlyException
DateTimeFormatterFactory
instead. Since v5.2.public static Date parseDate(String paramValue, Locale locale)
DateTimeFormatterFactory
instead. Since v5.2.public static ApplicationUser getUserParam(Map params, String s)
public static List getListParam(Map params, String key)
public static List<Long> makeListLong(List<String> list)
public static String[] getStringArrayParam(Map params, String paramName)
params
- the map of parametersparamName
- the name of the parameterpublic 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 forpublic 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 convertedpublic static boolean getBooleanParam(Map mapOfParameters, String paramName)
mapOfParameters
- the map of parametersparamName
- the parameter name to usepublic static Collection swapNulls(Collection col)
public static List<Long> getLongListFromStringArray(String[] ar)
public static String[] getStringArrayFromList(Collection entities)
Copyright © 2002-2019 Atlassian. All Rights Reserved.