public final class RequestHeader extends MessageHeader
Modifier and Type | Field and Description |
---|---|
static RequestHeader |
DEFAULT
A default request header object.
|
Constructor and Description |
---|
RequestHeader(Method method,
java.net.URI uri,
MessageProtocol protocol,
org.pcollections.PSequence<MessageProtocol> acceptedResponseProtocols,
java.util.Optional<java.security.Principal> principal,
org.pcollections.PMap<String,org.pcollections.PSequence<String>> headers) |
Modifier and Type | Method and Description |
---|---|
org.pcollections.PSequence<MessageProtocol> |
acceptedResponseProtocols()
Get the accepted response protocols for this request.
|
RequestHeader |
clearPrincipal()
Return a copy of this request header with the principal cleared.
|
boolean |
equals(Object o) |
int |
hashCode() |
Method |
method()
Get the method used to make this request.
|
java.util.Optional<java.security.Principal> |
principal()
Get the principal for this request, if there is one.
|
RequestHeader |
replaceAllHeaders(org.pcollections.PMap<String,org.pcollections.PSequence<String>> headers)
Return a copy of this message header with the headers replaced by the given map of headers.
|
String |
toString() |
java.net.URI |
uri()
Get the URI for this request.
|
RequestHeader |
withAcceptedResponseProtocols(org.pcollections.PSequence<MessageProtocol> acceptedResponseProtocols)
Return a copy of this request header with the given accepted response protocols set.
|
RequestHeader |
withHeader(String name,
String value)
Return a copy of this message header with the given header added to the map of headers.
|
RequestHeader |
withMethod(Method method)
Return a copy of this request header with the given method set.
|
RequestHeader |
withPrincipal(java.security.Principal principal)
Return a copy of this request header with the principal set.
|
RequestHeader |
withProtocol(MessageProtocol protocol)
Return a copy of this message header with the given protocol.
|
RequestHeader |
withUri(java.net.URI uri)
Return a copy of this request header with the given uri set.
|
getHeader, headers, protocol
public static final RequestHeader DEFAULT
ServiceCall.handleRequestHeader(Function)
public RequestHeader(Method method, java.net.URI uri, MessageProtocol protocol, org.pcollections.PSequence<MessageProtocol> acceptedResponseProtocols, java.util.Optional<java.security.Principal> principal, org.pcollections.PMap<String,org.pcollections.PSequence<String>> headers)
public Method method()
public java.net.URI uri()
public org.pcollections.PSequence<MessageProtocol> acceptedResponseProtocols()
public java.util.Optional<java.security.Principal> principal()
public RequestHeader withMethod(Method method)
method
- The method to set.public RequestHeader withUri(java.net.URI uri)
uri
- The uri to set.public RequestHeader withProtocol(MessageProtocol protocol)
MessageHeader
withProtocol
in class MessageHeader
protocol
- The protocol to set.public RequestHeader withAcceptedResponseProtocols(org.pcollections.PSequence<MessageProtocol> acceptedResponseProtocols)
acceptedResponseProtocols
- The accepted response protocols to set.public RequestHeader withPrincipal(java.security.Principal principal)
principal
- The principal to set.public RequestHeader clearPrincipal()
public RequestHeader replaceAllHeaders(org.pcollections.PMap<String,org.pcollections.PSequence<String>> headers)
MessageHeader
replaceAllHeaders
in class MessageHeader
headers
- The map of headers.public RequestHeader withHeader(String name, String value)
MessageHeader
withHeader
in class MessageHeader
name
- The name of the header to add.value
- The value of the header to add.public String toString()
toString
in class Object
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object