Class HttpHeaders
- java.lang.Object
-
- com.github.nosan.embedded.cassandra.commons.web.HttpHeaders
-
-
Constructor Summary
Constructors Constructor Description HttpHeaders()Create new emptyHttpHeaders.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String name, String value)Adds the given value to the list of headers for the given name.voidclear()booleancontainsKey(Object name)booleancontainsValue(Object value)static HttpHeaderscopyOf(Map<String,List<String>> headers)Creates HTTP headers.Set<Map.Entry<String,List<String>>>entrySet()booleanequals(Object o)List<String>get(Object name)Optional<String>getFirst(String name)Gets a first header value.inthashCode()booleanisEmpty()Set<String>keySet()List<String>put(String name, List<String> values)voidputAll(Map<? extends String,? extends List<String>> headers)static HttpHeadersreadOnly(Map<String,List<String>> headers)Creates read-only HTTP headers.List<String>remove(Object name)voidset(String name, String value)Sets the given value as the sole header value for the given name.intsize()StringtoString()Collection<List<String>>values()-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
HttpHeaders
public HttpHeaders()
Create new emptyHttpHeaders.
-
-
Method Detail
-
readOnly
public static HttpHeaders readOnly(Map<String,List<String>> headers)
Creates read-only HTTP headers.- Parameters:
headers- the headers for which read-only view is to be returned.- Returns:
- read only HTTP headers
-
copyOf
public static HttpHeaders copyOf(Map<String,List<String>> headers)
Creates HTTP headers.- Parameters:
headers- the headers to copy from- Returns:
- HTTP headers
-
containsKey
public boolean containsKey(Object name)
- Specified by:
containsKeyin interfaceMap<String,List<String>>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<String,List<String>>
-
getFirst
public Optional<String> getFirst(String name)
Gets a first header value.- Parameters:
name- the header name- Returns:
- the first string value associated with the name or empty
-
add
public void add(String name, String value)
Adds the given value to the list of headers for the given name. If the mapping does not already exist, then it is created.- Parameters:
name- the header namevalue- the header value
-
set
public void set(String name, String value)
Sets the given value as the sole header value for the given name. If the mapping does not already exist, then it is created.- Parameters:
name- the header namevalue- the header value to set.
-
values
public Collection<List<String>> values()
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
-