public static class MockHttpTransport.Builder
Constructors
Builder()
public Builder()
Constructs a new Builder. Note that this constructor was protected
in version
1.17 and its predecessors, and was made public
in version 1.18.
Methods
build()
public MockHttpTransport build()
Builds a new instance of MockHttpTransport.
Type | Description |
MockHttpTransport |
getLowLevelHttpRequest()
public final MockLowLevelHttpRequest getLowLevelHttpRequest()
Returns the MockLowLevelHttpRequest that is associated with this Builder, or
null
if no such instance exists.
Type | Description |
MockLowLevelHttpRequest |
getSupportedMethods()
public final Set<String> getSupportedMethods()
Returns the supported HTTP methods or null
to specify that all methods are supported.
Type | Description |
Set<String> |
setLowLevelHttpRequest(MockLowLevelHttpRequest lowLevelHttpRequest)
public final MockHttpTransport.Builder setLowLevelHttpRequest(MockLowLevelHttpRequest lowLevelHttpRequest)
Sets the MockLowLevelHttpRequest that will be returned by #buildRequest, if
non-null
. If null
, #buildRequest will create a new MockLowLevelHttpRequest arguments.
Note that the user can set a low level HTTP Request only if a low level HTTP response has not been set on this instance.
Name | Description |
lowLevelHttpRequest | MockLowLevelHttpRequest |
Type | Description |
MockHttpTransport.Builder |
setLowLevelHttpResponse(MockLowLevelHttpResponse lowLevelHttpResponse)
public final MockHttpTransport.Builder setLowLevelHttpResponse(MockLowLevelHttpResponse lowLevelHttpResponse)
Sets the MockLowLevelHttpResponse that will be the result when the MockLowLevelHttpRequest returned by #buildRequest is executed. Note that the response can be set only the caller has not provided a MockLowLevelHttpRequest via #setLowLevelHttpRequest.
Name | Description |
lowLevelHttpResponse | MockLowLevelHttpResponse |
Type | Description |
MockHttpTransport.Builder |
setSupportedMethods(Set<String> supportedMethods)
public final MockHttpTransport.Builder setSupportedMethods(Set<String> supportedMethods)
Sets the supported HTTP methods or null
to specify that all methods are supported.
Name | Description |
supportedMethods | Set<String> |
Type | Description |
MockHttpTransport.Builder |