| org.restlet.util.Series
Series | abstract public class Series extends WrapperList (Code) | | Modifiable list of entries with many helper methods. Note that this class
uses the Parameter class as the template type. This allows you to use an
instance of this class as any other java.util.List, in particular all the
helper methods in java.util.Collections.
author: Jerome Louvel (contact@noelios.com) See Also: org.restlet.data.Parameter See Also: java.util.Collections See Also: java.util.List |
Field Summary | |
final public static Object | EMPTY_VALUE A marker for empty values to differentiate from non existing values
(null). |
Constructor Summary | |
public | Series() Constructor. | public | Series(int initialCapacity) Constructor. | public | Series(List<E> delegate) Constructor. |
Method Summary | |
public boolean | add(String name, String value) Creates then adds a parameter at the end of the list.
Parameters: name - The parameter name. Parameters: value - The parameter value. | public void | copyTo(Map<String, Object> params) Copies the parameters whose name is a key in the given map. If a
matching parameter is found, its value is put in the map. If
multiple values are found, a list is created and set in the map. | abstract public E | createEntry(String name, String value) Creates a new entry.
Parameters: name - The name of the entry. Parameters: value - The value of the entry. | abstract public Series<E> | createSeries(List<E> delegate) Creates a new series.
Parameters: delegate - Optional delegate series. | public E | getFirst(String name) Returns the first parameter found with the given name.
Parameters: name - The parameter name (case sensitive). | public E | getFirst(String name, boolean ignoreCase) Returns the first parameter found with the given name.
Parameters: name - The parameter name. Parameters: ignoreCase - Indicates if the name comparison is case sensitive. | public String | getFirstValue(String name) Returns the value of the first parameter found with the given name.
Parameters: name - The parameter name (case sensitive). | public String | getFirstValue(String name, boolean ignoreCase) Returns the value of the first parameter found with the given name.
Parameters: name - The parameter name. Parameters: ignoreCase - Indicates if the name comparison is case sensitive. | public String | getFirstValue(String name, boolean ignoreCase, String defaultValue) Returns the value of the first parameter found with the given name.
Parameters: name - The parameter name. Parameters: ignoreCase - Indicates if the name comparison is case sensitive. Parameters: defaultValue - The default value to return if no matching parameter found. | public String | getFirstValue(String name, String defaultValue) Returns the value of the first parameter found with the given name.
Parameters: name - The parameter name (case sensitive). Parameters: defaultValue - The default value to return if no matching parameter found. | public Set<String> | getNames() Returns the set of parameter names (case sensitive). | public String | getValues(String name) Returns the values of the parameters with a given name. | public String | getValues(String name, String separator, boolean ignoreCase) Returns the parameter values with a given name. | public boolean | removeAll(String name) Removes all the parameters with a given name.
Parameters: name - The parameter name (case sensitive). | public boolean | removeAll(String name, boolean ignoreCase) Removes all the parameters with a given name.
Parameters: name - The parameter name. Parameters: ignoreCase - Indicates if the name comparison is case sensitive. | public boolean | removeFirst(String name) Removes from this list the first entry whose name equals the specified
name ignoring the case.
Parameters: name - The name of the entries to be removed (case sensitive). | public boolean | removeFirst(String name, boolean ignoreCase) Removes from this list the first entry whose name equals the specified
name ignoring the case or not.
Parameters: name - The name of the entries to be removed. Parameters: ignoreCase - true if the comparison ignores the case, false otherwise. | public E | set(String name, String value, boolean ignoreCase) Replaces the value of the first parameter with the given name and removes
all other parameters with the same name.
Parameters: name - The parameter name. Parameters: value - The value to set. Parameters: ignoreCase - Indicates if the name comparison is case sensitive. | public Series<E> | subList(int fromIndex, int toIndex) Returns a view of the portion of this list between the specified
fromIndex, inclusive, and toIndex, exclusive.
Parameters: fromIndex - The start position. Parameters: toIndex - The end position (exclusive). | public Series<E> | subList(String name) Returns a list of all the values associated to the parameter name.
Parameters: name - The parameter name (case sensitive). | public Series<E> | subList(String name, boolean ignoreCase) Returns a list of all the values associated to the parameter name.
Parameters: name - The parameter name. Parameters: ignoreCase - Indicates if the name comparison is case sensitive. |
EMPTY_VALUE | final public static Object EMPTY_VALUE(Code) | | A marker for empty values to differentiate from non existing values
(null).
|
Series | public Series()(Code) | | Constructor.
|
Series | public Series(int initialCapacity)(Code) | | Constructor.
Parameters: initialCapacity - The initial list capacity. |
Series | public Series(List<E> delegate)(Code) | | Constructor.
Parameters: delegate - The delegate list. |
add | public boolean add(String name, String value)(Code) | | Creates then adds a parameter at the end of the list.
Parameters: name - The parameter name. Parameters: value - The parameter value. True (as per the general contract of the Collection.add method). |
copyTo | public void copyTo(Map<String, Object> params)(Code) | | Copies the parameters whose name is a key in the given map. If a
matching parameter is found, its value is put in the map. If
multiple values are found, a list is created and set in the map.
Parameters: params - The map controlling the copy. |
createEntry | abstract public E createEntry(String name, String value)(Code) | | Creates a new entry.
Parameters: name - The name of the entry. Parameters: value - The value of the entry. A new entry. |
createSeries | abstract public Series<E> createSeries(List<E> delegate)(Code) | | Creates a new series.
Parameters: delegate - Optional delegate series. A new series. |
getFirst | public E getFirst(String name)(Code) | | Returns the first parameter found with the given name.
Parameters: name - The parameter name (case sensitive). The first parameter found with the given name. |
getFirst | public E getFirst(String name, boolean ignoreCase)(Code) | | Returns the first parameter found with the given name.
Parameters: name - The parameter name. Parameters: ignoreCase - Indicates if the name comparison is case sensitive. The first parameter found with the given name. |
getFirstValue | public String getFirstValue(String name)(Code) | | Returns the value of the first parameter found with the given name.
Parameters: name - The parameter name (case sensitive). The value of the first parameter found with the given name. |
getFirstValue | public String getFirstValue(String name, boolean ignoreCase)(Code) | | Returns the value of the first parameter found with the given name.
Parameters: name - The parameter name. Parameters: ignoreCase - Indicates if the name comparison is case sensitive. The value of the first parameter found with the given name. |
getFirstValue | public String getFirstValue(String name, boolean ignoreCase, String defaultValue)(Code) | | Returns the value of the first parameter found with the given name.
Parameters: name - The parameter name. Parameters: ignoreCase - Indicates if the name comparison is case sensitive. Parameters: defaultValue - The default value to return if no matching parameter found. The value of the first parameter found with the given name or thedefault value. |
getFirstValue | public String getFirstValue(String name, String defaultValue)(Code) | | Returns the value of the first parameter found with the given name.
Parameters: name - The parameter name (case sensitive). Parameters: defaultValue - The default value to return if no matching parameter found. The value of the first parameter found with the given name or thedefault value. |
getNames | public Set<String> getNames()(Code) | | Returns the set of parameter names (case sensitive).
The set of parameter names. |
getValues | public String getValues(String name)(Code) | | Returns the values of the parameters with a given name. If multiple
parameters with the same name are found, all values are concatenated and
separated by a comma (like for HTTP message headers).
Parameters: name - The parameter name (case insensitive). The values of the parameters with a given name. |
getValues | public String getValues(String name, String separator, boolean ignoreCase)(Code) | | Returns the parameter values with a given name. If multiple parameters
with the same name are found, all values are concatenated and separated
by the given separator.
Parameters: name - The parameter name. Parameters: separator - The separator character. Parameters: ignoreCase - Indicates if the name comparison is case sensitive. The sequence of values. |
removeAll | public boolean removeAll(String name)(Code) | | Removes all the parameters with a given name.
Parameters: name - The parameter name (case sensitive). True if the list changed. |
removeAll | public boolean removeAll(String name, boolean ignoreCase)(Code) | | Removes all the parameters with a given name.
Parameters: name - The parameter name. Parameters: ignoreCase - Indicates if the name comparison is case sensitive. True if the list changed. |
removeFirst | public boolean removeFirst(String name)(Code) | | Removes from this list the first entry whose name equals the specified
name ignoring the case.
Parameters: name - The name of the entries to be removed (case sensitive). false if no entry has been removed, true otherwise. |
removeFirst | public boolean removeFirst(String name, boolean ignoreCase)(Code) | | Removes from this list the first entry whose name equals the specified
name ignoring the case or not.
Parameters: name - The name of the entries to be removed. Parameters: ignoreCase - true if the comparison ignores the case, false otherwise. false if no entry has been removed, true otherwise. |
set | public E set(String name, String value, boolean ignoreCase)(Code) | | Replaces the value of the first parameter with the given name and removes
all other parameters with the same name.
Parameters: name - The parameter name. Parameters: value - The value to set. Parameters: ignoreCase - Indicates if the name comparison is case sensitive. The parameter set or added. |
subList | public Series<E> subList(int fromIndex, int toIndex)(Code) | | Returns a view of the portion of this list between the specified
fromIndex, inclusive, and toIndex, exclusive.
Parameters: fromIndex - The start position. Parameters: toIndex - The end position (exclusive). The sub-list. |
subList | public Series<E> subList(String name)(Code) | | Returns a list of all the values associated to the parameter name.
Parameters: name - The parameter name (case sensitive). The list of values. |
subList | public Series<E> subList(String name, boolean ignoreCase)(Code) | | Returns a list of all the values associated to the parameter name.
Parameters: name - The parameter name. Parameters: ignoreCase - Indicates if the name comparison is case sensitive. The list of values. |
|
|