Package com.sodius.oslc.server
Class OslcRequests.HttpServletRequestWrapperBuilder
- java.lang.Object
-
- com.sodius.oslc.server.OslcRequests.HttpServletRequestWrapperBuilder
-
- Enclosing class:
- OslcRequests
public static class OslcRequests.HttpServletRequestWrapperBuilder extends Object
A builder of request wrapper.- Since:
- 1.14.0
- See Also:
OslcRequests.wrapper()
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OslcRequests.HttpServletRequestWrapperBuilder
authType(String authType)
Overrides the name of the authentication scheme used to protect the servlet.HttpServletRequest
build()
Creates a wrapped request instance with the values overridden through this builder.OslcRequests.HttpServletRequestWrapperBuilder
header(String name, String... values)
Overrides the values of a given header.OslcRequests.HttpServletRequestWrapperBuilder
method(String method)
Overrides the name of the HTTP method.OslcRequests.HttpServletRequestWrapperBuilder
removeHeader(String name)
Removes a given header.
-
-
-
Method Detail
-
method
public OslcRequests.HttpServletRequestWrapperBuilder method(String method)
Overrides the name of the HTTP method.- Parameters:
method
- the new name of the HTTP method.- Returns:
- this builder instance.
- See Also:
HttpServletRequest.getMethod()
-
authType
public OslcRequests.HttpServletRequestWrapperBuilder authType(String authType)
Overrides the name of the authentication scheme used to protect the servlet.- Parameters:
authType
- the new name of the authentication scheme.- Returns:
- this builder instance.
- See Also:
HttpServletRequest.getAuthType()
-
header
public OslcRequests.HttpServletRequestWrapperBuilder header(String name, String... values)
Overrides the values of a given header. This method can be used to add a header that is not present in underlying request.- Parameters:
name
- the name of the header to override.values
- the new values of the header.- Returns:
- this builder instance.
- See Also:
removeHeader(String)
-
removeHeader
public OslcRequests.HttpServletRequestWrapperBuilder removeHeader(String name)
Removes a given header.- Parameters:
name
- the name of the header to remove.- Returns:
- this builder instance.
-
build
public HttpServletRequest build()
Creates a wrapped request instance with the values overridden through this builder.- Returns:
- a wrapped request with some overridden values.
-
-