public interface MultiMap extends Iterable<Map.Entry<String,String>>
Modifier and Type | Method and Description |
---|---|
MultiMap |
add(CharSequence name,
CharSequence value) |
MultiMap |
add(CharSequence name,
Iterable<CharSequence> values) |
MultiMap |
add(String name,
Iterable<String> values)
Adds a new values under the specified name
|
MultiMap |
add(String name,
String value)
Adds a new value with the specified name and value.
|
MultiMap |
addAll(Map<String,String> headers)
Adds all the entries from a Map to this
|
MultiMap |
addAll(MultiMap map)
Adds all the entries from another MultiMap to this one
|
MultiMap |
clear()
Removes all
|
boolean |
contains(CharSequence name) |
boolean |
contains(String name)
Checks to see if there is a value with the specified name
|
List<Map.Entry<String,String>> |
entries()
Returns all entries it contains.
|
String |
get(CharSequence name) |
String |
get(String name)
Returns the value of with the specified name.
|
List<String> |
getAll(CharSequence name) |
List<String> |
getAll(String name)
Returns the values with the specified name
|
boolean |
isEmpty()
Return true if empty
|
Set<String> |
names()
Gets a immutable
Set of all names |
MultiMap |
remove(CharSequence name) |
MultiMap |
remove(String name)
Removes the value with the given name
|
MultiMap |
set(CharSequence name,
CharSequence value) |
MultiMap |
set(CharSequence name,
Iterable<CharSequence> values) |
MultiMap |
set(String name,
Iterable<String> values)
Sets values for the specified name.
|
MultiMap |
set(String name,
String value)
Sets a value under the specified name.
|
MultiMap |
setAll(Map<String,String> headers)
Cleans and set all values of the given instance
|
MultiMap |
setAll(MultiMap map)
Cleans this instance.
|
int |
size()
Return the number of names.
|
forEach, iterator, spliterator
String get(CharSequence name)
String get(String name)
Returns the value of with the specified name. If there are more than one values for the specified name, the first value is returned.
name
- The name of the header to searchnull
if there is no such entryList<String> getAll(String name)
Returns the values with the specified name
name
- The name to searchList
of values which will be empty if no values
are foundList<String> getAll(CharSequence name)
List<Map.Entry<String,String>> entries()
Returns all entries it contains.
List
of the name-value entries, which will be
empty if no pairs are foundboolean contains(String name)
Checks to see if there is a value with the specified name
name
- The name to search forboolean contains(CharSequence name)
boolean isEmpty()
Return true if empty
MultiMap add(String name, String value)
Adds a new value with the specified name and value.
name
- The namevalue
- The value being addedthis
MultiMap add(CharSequence name, CharSequence value)
MultiMap add(String name, Iterable<String> values)
Adds a new values under the specified name
name
- The name being setvalues
- The valuesthis
MultiMap add(CharSequence name, Iterable<CharSequence> values)
MultiMap addAll(MultiMap map)
Adds all the entries from another MultiMap to this one
this
MultiMap addAll(Map<String,String> headers)
Adds all the entries from a Map to this
this
MultiMap set(String name, String value)
Sets a value under the specified name.
If there is an existing header with the same name, it is removed.
name
- The namevalue
- The valuethis
MultiMap set(CharSequence name, CharSequence value)
MultiMap set(String name, Iterable<String> values)
Sets values for the specified name.
name
- The name of the headers being setvalues
- The values of the headers being setthis
MultiMap set(CharSequence name, Iterable<CharSequence> values)
MultiMap setAll(Map<String,String> headers)
Cleans and set all values of the given instance
this
MultiMap remove(String name)
Removes the value with the given name
name
- The name of the value to removethis
MultiMap remove(CharSequence name)
MultiMap clear()
Removes all
this
int size()
Return the number of names.
Copyright © 2014. All Rights Reserved.