public final class CaseInsensitiveHeaders extends Object implements MultiMap
This multi-map implementation has case insensitive keys, and can be used to hold some HTTP headers prior to making an HTTP request.
Constructor and Description |
---|
CaseInsensitiveHeaders() |
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 strVal)
Adds a new value with the specified name and value.
|
MultiMap |
addAll(Map<String,String> map)
Adds all the entries from a Map to this
|
MultiMap |
addAll(MultiMap headers)
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
|
Iterator<Map.Entry<String,String>> |
iterator() |
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 strVal)
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 headers)
Cleans this instance.
|
int |
size()
Return the number of names.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public MultiMap setAll(MultiMap headers)
MultiMap
Cleans this instance.
public MultiMap setAll(Map<String,String> headers)
MultiMap
Cleans and set all values of the given instance
public int size()
MultiMap
Return the number of names.
public MultiMap add(String name, String strVal)
MultiMap
Adds a new value with the specified name and value.
public MultiMap add(String name, Iterable<String> values)
MultiMap
Adds a new values under the specified name
public MultiMap addAll(MultiMap headers)
MultiMap
Adds all the entries from another MultiMap to this one
public MultiMap addAll(Map<String,String> map)
MultiMap
Adds all the entries from a Map to this
public MultiMap remove(String name)
MultiMap
Removes the value with the given name
public MultiMap set(String name, String strVal)
MultiMap
Sets a value under the specified name.
If there is an existing header with the same name, it is removed.
public MultiMap set(String name, Iterable<String> values)
MultiMap
Sets values for the specified name.
public String get(String name)
MultiMap
Returns the value of with the specified name. If there are more than one values for the specified name, the first value is returned.
public List<String> getAll(String name)
MultiMap
Returns the values with the specified name
public List<Map.Entry<String,String>> entries()
MultiMap
Returns all entries it contains.
public boolean contains(String name)
MultiMap
Checks to see if there is a value with the specified name
public boolean isEmpty()
MultiMap
Return true if empty
public Set<String> names()
MultiMap
Gets a immutable Set
of all names
public String get(CharSequence name)
public List<String> getAll(CharSequence name)
public boolean contains(CharSequence name)
public MultiMap add(CharSequence name, CharSequence value)
public MultiMap add(CharSequence name, Iterable<CharSequence> values)
public MultiMap set(CharSequence name, CharSequence value)
public MultiMap set(CharSequence name, Iterable<CharSequence> values)
public MultiMap remove(CharSequence name)
Copyright © 2014. All Rights Reserved.