Package com.atlassian.jira.rest.api.util
Class StringList
java.lang.Object
com.atlassian.jira.rest.api.util.StringList
This class is used for dealing with query parameters that contain comma-separated lists of strings. The utility
methods
fromQueryParam(String) and toQueryParam() can be used to convert back and forth between
String and StringList.- Since:
- v5.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new, empty, StringList.StringList(Iterable<String> fields) Constructs the List of Strings from another List.StringList(String queryParam) Constructs the List of Strings from a query param string. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableList<String>asList()Returns an immutable list of strings.extend(StringList stringList) Returns a new StringList containing the concatenation of this StringList's fields and the fields in the given string list.static StringListCreates a new StringList from an Iterable of strings.static StringListCreates a new StringList from an array of strings.static StringListfromQueryParam(String queryParam) Creates a new StringList from a query parameter.static StringListjoinLists(List<StringList> stringLists) Returns a new StringList containing the concatenation of all of the StringLists in the given List.Returns a string representation of this StringList, suitable for using in a query param.toString()
-
Constructor Details
-
StringList
public StringList()Creates a new, empty, StringList. -
StringList
Constructs the List of Strings from a query param string.- Parameters:
queryParam- a String containing the query param value
-
StringList
Constructs the List of Strings from another List.- Parameters:
fields- a List of Strings
-
-
Method Details
-
fromList
Creates a new StringList from an array of strings.- Parameters:
strings- an array of String- Returns:
- a new StringList
-
fromList
Creates a new StringList from an Iterable of strings.- Parameters:
strings- an array of String- Returns:
- a new StringList
-
fromQueryParam
Creates a new StringList from a query parameter. The input string is expected to be a comma-separated list of strings.- Parameters:
queryParam- a comma-separated String list- Returns:
- a new StringList
-
asList
Returns an immutable list of strings.- Returns:
- an ImmutableList<String>
-
toQueryParam
Returns a string representation of this StringList, suitable for using in a query param. This essentially a comma-separated list of values.- Returns:
- a String containing a representation of this StringList
-
extend
Returns a new StringList containing the concatenation of this StringList's fields and the fields in the given string list.- Parameters:
stringList- a StringList- Returns:
- a new StringList
-
joinLists
Returns a new StringList containing the concatenation of all of the StringLists in the given List.- Parameters:
stringLists- a List of StringLists- Returns:
- a new StringList
-
toString
-