Class StitchDocRequest.Builder
- java.lang.Object
-
- com.mongodb.stitch.core.internal.net.StitchRequest.Builder
-
- com.mongodb.stitch.core.internal.net.StitchDocRequest.Builder
-
- Enclosing class:
- StitchDocRequest
public static class StitchDocRequest.Builder extends StitchRequest.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
Constructs a new builder.
-
Method Summary
Modifier and Type Method Description StitchDocRequest
build()
Builds theStitchDocRequest
.StitchDocRequest
build(CodecRegistry codecRegistry)
Builds theStitchDocRequest
using the given codec registry for encoding the document.Document
getDocument()
Returns the document to send in the request.StitchDocRequest.Builder
withBody(byte[] body)
Sets a copy of the body that will be sent along with the request.StitchDocRequest.Builder
withDocument(Document document)
Sets the document to send in the request.StitchDocRequest.Builder
withHeaders(Map<String,String> headers)
Sets the headers that will be included in the request.StitchDocRequest.Builder
withMethod(Method method)
Sets the HTTP method of the request.StitchDocRequest.Builder
withPath(String path)
Sets the Stitch API path of the request.-
Methods inherited from class com.mongodb.stitch.core.internal.net.StitchRequest.Builder
getBody, getHeaders, getMethod, getPath, getTimeout, withTimeout
-
-
-
-
Method Detail
-
withDocument
public StitchDocRequest.Builder withDocument(Document document)
Sets the document to send in the request.- Parameters:
document
- the document to send in the request.- Returns:
- the builder.
-
getDocument
public Document getDocument()
Returns the document to send in the request.- Returns:
- the document to send in the request.
-
withMethod
public StitchDocRequest.Builder withMethod(Method method)
Sets the HTTP method of the request.- Overrides:
withMethod
in classStitchRequest.Builder
- Parameters:
method
- the HTTP method of the request.- Returns:
- the builder.
-
withPath
public StitchDocRequest.Builder withPath(String path)
Sets the Stitch API path of the request.- Overrides:
withPath
in classStitchRequest.Builder
- Parameters:
path
- the Stitch API path of the request.- Returns:
- the builder.
-
withHeaders
public StitchDocRequest.Builder withHeaders(Map<String,String> headers)
Sets the headers that will be included in the request.- Overrides:
withHeaders
in classStitchRequest.Builder
- Parameters:
headers
- the headers that will be included in the request.- Returns:
- the builder.
-
withBody
public StitchDocRequest.Builder withBody(byte[] body)
Sets a copy of the body that will be sent along with the request.- Overrides:
withBody
in classStitchRequest.Builder
- Parameters:
body
- a copy of the body that will be sent along with the request.- Returns:
- the builder.
-
build
public StitchDocRequest build()
Builds theStitchDocRequest
.- Overrides:
build
in classStitchRequest.Builder
- Returns:
- the built
StitchDocRequest
.
-
build
public StitchDocRequest build(CodecRegistry codecRegistry)
Builds theStitchDocRequest
using the given codec registry for encoding the document.- Parameters:
codecRegistry
- the registry to use for encoding the document.- Returns:
- the built
StitchDocRequest
.
-
-