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 aStitchAppClientConfigurationobject.
-
-
Constructor Summary
Constructors Constructor Description Builder()Constructs a new builder.
-
Method Summary
Modifier and Type Method Description StitchAppClientConfigurationbuild()Builds theStitchAppClientConfiguration.StringgetLocalAppName()Gets the name of the local application.StringgetLocalAppVersion()Gets the current version of the local application.StitchAppClientConfiguration.BuilderwithBaseUrl(String baseUrl)Sets the base URL of the Stitch server that the client will communicate with to retrieve application metadata.StitchAppClientConfiguration.BuilderwithCodecRegistry(CodecRegistry codecRegistry)Merges the provided codec registry with the default codec registry.StitchAppClientConfiguration.BuilderwithDataDirectory(String dataDirectory)Sets the local directory in which Stitch can store any data (e.g.StitchAppClientConfiguration.BuilderwithDefaultRequestTimeout(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.BuilderwithLocalAppName(String localAppName)Sets the name of the local application.StitchAppClientConfiguration.BuilderwithLocalAppVersion(String localAppVersion)Sets the current version of the local application.StitchAppClientConfiguration.BuilderwithNetworkMonitor(NetworkMonitor networkMonitor)Sets theNetworkMonitorthat the client will used to check internet status.StitchAppClientConfiguration.BuilderwithStorage(Storage storage)Sets the underlying storage for Stitch to persist client specific data to.StitchAppClientConfiguration.BuilderwithTransport(Transport transport)Sets theTransportthat 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:
withBaseUrlin 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:
withStoragein 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:
withDataDirectoryin 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 theTransportthat the client will use to make round trips to the Stitch server.- Overrides:
withTransportin classStitchClientConfiguration.Builder- Parameters:
transport- theTransportthat 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:
withDefaultRequestTimeoutin 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:
withCodecRegistryin classStitchClientConfiguration.Builder- Parameters:
codecRegistry- the codec registry to merge with the default registry.- Returns:
- the builder.
-
withNetworkMonitor
public StitchAppClientConfiguration.Builder withNetworkMonitor(NetworkMonitor networkMonitor)
Sets theNetworkMonitorthat the client will used to check internet status.- Overrides:
withNetworkMonitorin classStitchClientConfiguration.Builder- Parameters:
networkMonitor- theNetworkMonitorthat the client will use check internet status.- Returns:
- the builder.
-
build
public StitchAppClientConfiguration build()
Builds theStitchAppClientConfiguration.- Overrides:
buildin classStitchClientConfiguration.Builder- Returns:
- the built
StitchAppClientConfiguration.
-
-