Package com.couchbase.client.java.env
Class ClusterEnvironment.Builder
- java.lang.Object
-
- com.couchbase.client.core.env.CoreEnvironment.Builder<ClusterEnvironment.Builder>
-
- com.couchbase.client.java.env.ClusterEnvironment.Builder
-
- Enclosing class:
- ClusterEnvironment
public static class ClusterEnvironment.Builder extends CoreEnvironment.Builder<ClusterEnvironment.Builder>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClusterEnvironment
build()
Turns this builder into a realClusterEnvironment
.ClusterEnvironment.Builder
jsonSerializer(JsonSerializer jsonSerializer)
Sets the default serializer for converting between JSON and Java objects.ClusterEnvironment.Builder
load(ClusterPropertyLoader loader)
Immediately loads the properties from the given loader into the environment.ClusterEnvironment.Builder
transcoder(Transcoder transcoder)
Allows to override the default transcoder going to be used for all KV operations.-
Methods inherited from class com.couchbase.client.core.env.CoreEnvironment.Builder
compressionConfig, compressionConfig, eventBus, ioConfig, ioConfig, ioEnvironment, load, loggerConfig, loggerConfig, maxNumRequestsInRetry, orphanReporterConfig, orphanReporterConfig, requestTracer, retryStrategy, scheduler, securityConfig, securityConfig, self, timeoutConfig, timeoutConfig
-
-
-
-
Method Detail
-
load
public ClusterEnvironment.Builder load(ClusterPropertyLoader loader)
Immediately loads the properties from the given loader into the environment.- Parameters:
loader
- the loader to load the properties from.- Returns:
- this
ClusterEnvironment.Builder
for chaining purposes.
-
jsonSerializer
public ClusterEnvironment.Builder jsonSerializer(JsonSerializer jsonSerializer)
Sets the default serializer for converting between JSON and Java objects.Providing your own serializer gives you complete control over the conversion.
If this method is not called, the client's behavior depends on whether Jackson is in the class path. If Jackson is present, an instance of
JacksonJsonSerializer
will be used. Otherwise the client will fall back toDefaultJsonSerializer
.- Parameters:
jsonSerializer
- the serializer used for all JSON values.- Returns:
- this
ClusterEnvironment.Builder
for chaining purposes. - See Also:
JacksonJsonSerializer
-
transcoder
public ClusterEnvironment.Builder transcoder(Transcoder transcoder)
Allows to override the default transcoder going to be used for all KV operations.- Parameters:
transcoder
- the transcoder that should be used by default.- Returns:
- this
ClusterEnvironment.Builder
for chaining purposes.
-
build
public ClusterEnvironment build()
Turns this builder into a realClusterEnvironment
.- Overrides:
build
in classCoreEnvironment.Builder<ClusterEnvironment.Builder>
- Returns:
- the created cluster environment.
-
-