Package com.mongodb.stitch.core
Class StitchAppClientConfiguration.Builder
- java.lang.Object
-
- com.mongodb.stitch.core.StitchClientConfiguration.Builder
-
- com.mongodb.stitch.core.StitchAppClientConfiguration.Builder
-
- Enclosing class:
- StitchAppClientConfiguration
public static class StitchAppClientConfiguration.Builder extends StitchClientConfiguration.Builder
A builder that can build aStitchAppClientConfiguration
object.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Constructs a new builder.
-
Method Summary
Modifier and Type Method Description StitchAppClientConfiguration
build()
Builds theStitchAppClientConfiguration
.String
getLocalAppName()
Gets the name of the local application.String
getLocalAppVersion()
Gets the current version of the local application.StitchAppClientConfiguration.Builder
withBaseUrl(String baseUrl)
Sets the base URL of the Stitch server that the client will communicate with to retrieve application metadata.StitchAppClientConfiguration.Builder
withCodecRegistry(CodecRegistry codecRegistry)
Merges the provided codec registry with the default codec registry.StitchAppClientConfiguration.Builder
withDataDirectory(String dataDirectory)
Sets the local directory in which Stitch can store any data (e.g.StitchAppClientConfiguration.Builder
withDefaultRequestTimeout(Long defaultRequestTimeout)
Sets the number of milliseconds that a `Transport` should spend by default on an HTTP round trip before failing with an error.StitchAppClientConfiguration.Builder
withLocalAppName(String localAppName)
Sets the name of the local application.StitchAppClientConfiguration.Builder
withLocalAppVersion(String localAppVersion)
Sets the current version of the local application.StitchAppClientConfiguration.Builder
withNetworkMonitor(NetworkMonitor networkMonitor)
Sets theNetworkMonitor
that the client will used to check internet status.StitchAppClientConfiguration.Builder
withStorage(Storage storage)
Sets the underlying storage for Stitch to persist client specific data to.StitchAppClientConfiguration.Builder
withTransport(Transport transport)
Sets theTransport
that the client will use to make round trips to the Stitch server.-
Methods inherited from class com.mongodb.stitch.core.StitchClientConfiguration.Builder
getBaseUrl, getCodecRegistry, getDataDirectory, getDefaultRequestTimeout, getNetworkMonitor, getStorage, getTransport
-
-
-
-
Method Detail
-
withLocalAppName
public StitchAppClientConfiguration.Builder withLocalAppName(String localAppName)
Sets the name of the local application.- Parameters:
localAppName
- the name of the local application.- Returns:
- the builder.
-
withLocalAppVersion
public StitchAppClientConfiguration.Builder withLocalAppVersion(String localAppVersion)
Sets the current version of the local application.- Parameters:
localAppVersion
- the current version of the local application.- Returns:
- the builder.
-
getLocalAppName
public String getLocalAppName()
Gets the name of the local application.- Returns:
- the name of the local application.
-
getLocalAppVersion
public String getLocalAppVersion()
Gets the current version of the local application.- Returns:
- the current version of the local application.
-
withBaseUrl
public StitchAppClientConfiguration.Builder withBaseUrl(String baseUrl)
Sets the base URL of the Stitch server that the client will communicate with to retrieve application metadata.- Overrides:
withBaseUrl
in classStitchClientConfiguration.Builder
- Parameters:
baseUrl
- the base URL of the Stitch server that the client will communicate with.- Returns:
- the builder.
-
withStorage
public StitchAppClientConfiguration.Builder withStorage(Storage storage)
Sets the underlying storage for Stitch to persist client specific data to.- Overrides:
withStorage
in classStitchClientConfiguration.Builder
- Parameters:
storage
- the underlying storage for Stitch to persist client specific data to.- Returns:
- the builder.
-
withDataDirectory
public StitchAppClientConfiguration.Builder withDataDirectory(String dataDirectory)
Sets the local directory in which Stitch can store any data (e.g. embedded MongoDB data directory).- Overrides:
withDataDirectory
in classStitchClientConfiguration.Builder
- Parameters:
dataDirectory
- the local directory in which Stitch can store any data.- Returns:
- the builder.
-
withTransport
public StitchAppClientConfiguration.Builder withTransport(Transport transport)
Sets theTransport
that the client will use to make round trips to the Stitch server.- Overrides:
withTransport
in classStitchClientConfiguration.Builder
- Parameters:
transport
- theTransport
that the client will use to make round trips to the Stitch server.- Returns:
- the builder.
-
withDefaultRequestTimeout
public StitchAppClientConfiguration.Builder withDefaultRequestTimeout(Long defaultRequestTimeout)
Sets the number of milliseconds that a `Transport` should spend by default on an HTTP round trip before failing with an error. Important: If a request timeout was specified for a specific operation, for example in a function call, that timeout will override this one.- Overrides:
withDefaultRequestTimeout
in classStitchClientConfiguration.Builder
- Parameters:
defaultRequestTimeout
- the number of milliseconds that a `Transport` should spend by default on an HTTP round trip before failing with an error.- Returns:
- the builder.
-
withCodecRegistry
public StitchAppClientConfiguration.Builder withCodecRegistry(CodecRegistry codecRegistry)
Merges the provided codec registry with the default codec registry.- Overrides:
withCodecRegistry
in classStitchClientConfiguration.Builder
- Parameters:
codecRegistry
- the codec registry to merge with the default registry.- Returns:
- the builder.
-
withNetworkMonitor
public StitchAppClientConfiguration.Builder withNetworkMonitor(NetworkMonitor networkMonitor)
Sets theNetworkMonitor
that the client will used to check internet status.- Overrides:
withNetworkMonitor
in classStitchClientConfiguration.Builder
- Parameters:
networkMonitor
- theNetworkMonitor
that the client will use check internet status.- Returns:
- the builder.
-
build
public StitchAppClientConfiguration build()
Builds theStitchAppClientConfiguration
.- Overrides:
build
in classStitchClientConfiguration.Builder
- Returns:
- the built
StitchAppClientConfiguration
.
-
-