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 StitchDocRequestbuild()Builds theStitchDocRequest.StitchDocRequestbuild(CodecRegistry codecRegistry)Builds theStitchDocRequestusing the given codec registry for encoding the document.DocumentgetDocument()Returns the document to send in the request.StitchDocRequest.BuilderwithBody(byte[] body)Sets a copy of the body that will be sent along with the request.StitchDocRequest.BuilderwithDocument(Document document)Sets the document to send in the request.StitchDocRequest.BuilderwithHeaders(Map<String,String> headers)Sets the headers that will be included in the request.StitchDocRequest.BuilderwithMethod(Method method)Sets the HTTP method of the request.StitchDocRequest.BuilderwithPath(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:
withMethodin 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:
withPathin 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:
withHeadersin 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:
withBodyin 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:
buildin classStitchRequest.Builder- Returns:
- the built
StitchDocRequest.
-
build
public StitchDocRequest build(CodecRegistry codecRegistry)
Builds theStitchDocRequestusing the given codec registry for encoding the document.- Parameters:
codecRegistry- the registry to use for encoding the document.- Returns:
- the built
StitchDocRequest.
-
-