Class HttpHeadersBuilder
- java.lang.Object
-
- com.contentgrid.opa.client.rest.client.jdk.HttpHeadersBuilder
-
- All Implemented Interfaces:
HttpRequestHeaders
public class HttpHeadersBuilder extends java.lang.Object implements HttpRequestHeaders
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.contentgrid.opa.client.rest.http.HttpRequestHeaders
HttpRequestHeaders.Headers
-
-
Constructor Summary
Constructors Constructor Description HttpHeadersBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpRequestHeadersadd(java.lang.String headerName, java.lang.String headerValue)Adds the given name value pair to the set of headers for this request.voidforEach(java.util.function.BiConsumer<java.lang.String,java.util.List<java.lang.String>> callback)Performs the provided callback for each header.java.util.List<java.lang.String>get(java.lang.String headerName)Get an immutable list of header values for the given header name, possibly empty.HttpRequestHeadersremove(java.lang.String headerName)Removes the header with the specified name, if present.HttpRequestHeadersset(java.lang.String headerName, java.lang.String... headerValues)Sets the given name value pair to the set of headers for this request.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.contentgrid.opa.client.rest.http.HttpRequestHeaders
accept, acceptCharset, contentType, contentType, getFirst
-
-
-
-
Method Detail
-
add
public HttpRequestHeaders add(java.lang.String headerName, java.lang.String headerValue)
Description copied from interface:HttpRequestHeadersAdds the given name value pair to the set of headers for this request. The given value is added to the list of values for that name.- Specified by:
addin interfaceHttpRequestHeaders- Parameters:
headerName- the header nameheaderValue- the header value- Returns:
- this instance
-
set
public HttpRequestHeaders set(java.lang.String headerName, java.lang.String... headerValues)
Description copied from interface:HttpRequestHeadersSets the given name value pair to the set of headers for this request.- Specified by:
setin interfaceHttpRequestHeaders- Parameters:
headerName- the header nameheaderValues- the header values- Returns:
- this instance
-
remove
public HttpRequestHeaders remove(java.lang.String headerName)
Description copied from interface:HttpRequestHeadersRemoves the header with the specified name, if present.- Specified by:
removein interfaceHttpRequestHeaders- Parameters:
headerName- the header name- Returns:
- this instance
-
get
public java.util.List<java.lang.String> get(java.lang.String headerName)
Description copied from interface:HttpRequestHeadersGet an immutable list of header values for the given header name, possibly empty.- Specified by:
getin interfaceHttpRequestHeaders- Parameters:
headerName- the header name- Returns:
- the list of header values, or an empty list
-
forEach
public void forEach(java.util.function.BiConsumer<java.lang.String,java.util.List<java.lang.String>> callback)
Description copied from interface:HttpRequestHeadersPerforms the provided callback for each header.- Specified by:
forEachin interfaceHttpRequestHeaders
-
-