java.lang.Object |
↳ |
com.ning.http.client.FluentStringsMap |
Class Overview
An implementation of a String -> List<String>
map that adds a fluent interface, i.e. methods that
return this instance.
Summary
Public Methods |
FluentStringsMap
|
add(String key, String... values)
Adds the specified values and returns this object.
|
FluentStringsMap
|
add(String key, Collection<String> values)
Adds the specified values and returns this object.
|
FluentStringsMap
|
addAll(FluentStringsMap src)
Adds all key-values pairs from the given object to this object and returns this object.
|
FluentStringsMap
|
addAll(Map<String, Collection<String>> src)
Adds all key-values pairs from the given map to this object and returns this object.
|
void
|
clear()
|
boolean
|
containsKey(Object key)
|
boolean
|
containsValue(Object value)
|
FluentStringsMap
|
delete(String key)
Removes the values for the given key if present and returns this object.
|
FluentStringsMap
|
deleteAll(String... keys)
Removes the values for the given keys if present and returns this object.
|
FluentStringsMap
|
deleteAll(Collection<String> keys)
Removes the values for the given keys if present and returns this object.
|
Set<Entry<String, List<String>>>
|
entrySet()
|
boolean
|
equals(Object obj)
|
List<String>
|
get(Object key)
|
String
|
getFirstValue(String key)
Returns the value for the given key.
|
String
|
getJoinedValue(String key, String delimiter)
Returns the values for the given key joined into a single string using the given delimiter.
|
int
|
hashCode()
|
boolean
|
isEmpty()
|
Iterator<Entry<String, List<String>>>
|
iterator()
|
Set<String>
|
keySet()
|
List<String>
|
put(String key, List<String> value)
|
void
|
putAll(Map<? extends String, ? extends List<String>> values)
|
List<String>
|
remove(Object key)
|
FluentStringsMap
|
replace(String key, String... values)
Replaces the values for the given key with the given values.
|
FluentStringsMap
|
replace(String key, Collection<String> values)
Replaces the values for the given key with the given values.
|
FluentStringsMap
|
replaceAll(FluentStringsMap src)
Replace the values for all keys from the given map that are also present in this object, with the values from the given map.
|
FluentStringsMap
|
replaceAll(Map<? extends String, ? extends Collection<String>> src)
Replace the values for all keys from the given map that are also present in this object, with the values from the given map.
|
int
|
size()
|
String
|
toString()
|
Collection<List<String>>
|
values()
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0)
|
final
void
|
wait(long arg0, int arg1)
|
|
From interface
java.lang.Iterable
abstract
Iterator<T>
|
iterator()
|
|
From interface
java.util.Map
abstract
void
|
clear()
|
abstract
boolean
|
containsKey(Object arg0)
|
abstract
boolean
|
containsValue(Object arg0)
|
abstract
Set<Entry<K, V>>
|
entrySet()
|
abstract
boolean
|
equals(Object arg0)
|
abstract
V
|
get(Object arg0)
|
abstract
int
|
hashCode()
|
abstract
boolean
|
isEmpty()
|
abstract
Set<K>
|
keySet()
|
abstract
V
|
put(K arg0, V arg1)
|
abstract
void
|
putAll(Map<? extends K, ? extends V> arg0)
|
abstract
V
|
remove(Object arg0)
|
abstract
int
|
size()
|
abstract
Collection<V>
|
values()
|
|
Public Constructors
public
FluentStringsMap
()
public
FluentStringsMap
(Map<String, Collection<String>> src)
Public Methods
public
FluentStringsMap
add
(String key, String... values)
Adds the specified values and returns this object.
Parameters
key
| The key |
values
| The value(s); if null then this method has no effect. Use the empty string to
generate an empty value |
public
FluentStringsMap
add
(String key, Collection<String> values)
Adds the specified values and returns this object.
Parameters
key
| The key |
values
| The value(s); if null then this method has no effect. Use an empty collection
to generate an empty value |
Adds all key-values pairs from the given object to this object and returns this object.
public
FluentStringsMap
addAll
(Map<String, Collection<String>> src)
Adds all key-values pairs from the given map to this object and returns this object.
public
boolean
containsKey
(Object key)
public
boolean
containsValue
(Object value)
Removes the values for the given key if present and returns this object.
public
FluentStringsMap
deleteAll
(String... keys)
Removes the values for the given keys if present and returns this object.
public
FluentStringsMap
deleteAll
(Collection<String> keys)
Removes the values for the given keys if present and returns this object.
public
Set<Entry<String, List<String>>>
entrySet
()
public
boolean
equals
(Object obj)
public
List<String>
get
(Object key)
public
String
getFirstValue
(String key)
Returns the value for the given key. If there are multiple values for this key,
then only the first one will be returned.
public
String
getJoinedValue
(String key, String delimiter)
Returns the values for the given key joined into a single string using the given delimiter.
Returns
- The value as a single string
public
boolean
isEmpty
()
public
Iterator<Entry<String, List<String>>>
iterator
()
public
Set<String>
keySet
()
public
List<String>
put
(String key, List<String> value)
public
void
putAll
(Map<? extends String, ? extends List<String>> values)
public
List<String>
remove
(Object key)
public
FluentStringsMap
replace
(String key, String... values)
Replaces the values for the given key with the given values.
Parameters
key
| The key |
values
| The new values |
public
FluentStringsMap
replace
(String key, Collection<String> values)
Replaces the values for the given key with the given values.
Parameters
key
| The key |
values
| The new values |
Replace the values for all keys from the given map that are also present in this object, with the values from the given map.
All key-values from the given object that are not present in this object, will be added to it.
public
FluentStringsMap
replaceAll
(Map<? extends String, ? extends Collection<String>> src)
Replace the values for all keys from the given map that are also present in this object, with the values from the given map.
All key-values from the given object that are not present in this object, will be added to it.
public
String
toString
()
public
Collection<List<String>>
values
()