@Immutable public class

StringList

extends Object
java.lang.Object
   ↳ com.atlassian.jira.rest.api.util.StringList

Class Overview

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.

Summary

Public Constructors
StringList()
Creates a new, empty, StringList.
StringList(String queryParam)
Constructs the List of Strings from a query param string.
StringList(Iterable<String> fields)
Constructs the List of Strings from another List.
Public Methods
ImmutableList<String> asList()
Returns an immutable list of strings.
StringList extend(StringList stringList)
Returns a new StringList containing the concatenation of this StringList's fields and the fields in the given string list.
static StringList fromList(String... strings)
Creates a new StringList from an array of strings.
static StringList fromList(Iterable<String> strings)
Creates a new StringList from an Iterable of strings.
static StringList fromQueryParam(String queryParam)
Creates a new StringList from a query parameter.
static StringList joinLists(List<StringList> stringLists)
Returns a new StringList containing the concatenation of all of the StringLists in the given List.
String toQueryParam()
Returns a string representation of this StringList, suitable for using in a query param.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public StringList ()

Creates a new, empty, StringList.

public StringList (String queryParam)

Constructs the List of Strings from a query param string.

Parameters
queryParam a String containing the query param value

public StringList (Iterable<String> fields)

Constructs the List of Strings from another List.

Parameters
fields a List of Strings

Public Methods

public ImmutableList<String> asList ()

Returns an immutable list of strings.

Returns
  • an ImmutableList<String>

public StringList extend (StringList stringList)

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

public static StringList fromList (String... strings)

Creates a new StringList from an array of strings.

Parameters
strings an array of String
Returns
  • a new StringList

public static StringList fromList (Iterable<String> strings)

Creates a new StringList from an Iterable of strings.

Parameters
strings an array of String
Returns
  • a new StringList

public static StringList fromQueryParam (String queryParam)

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

public static StringList joinLists (List<StringList> stringLists)

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

public 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

public String toString ()