Class DefaultBucketSettings.Builder
java.lang.Object
com.couchbase.client.java.cluster.DefaultBucketSettings.Builder
- All Implemented Interfaces:
BucketSettings
- Enclosing class:
- DefaultBucketSettings
public static class DefaultBucketSettings.Builder extends Object implements BucketSettings
-
Constructor Summary
Constructors Constructor Description Builder() -
Method Summary
Modifier and Type Method Description DefaultBucketSettingsbuild()DefaultBucketSettingsbuild(JsonObject raw)Build theBucketSettingsfrom the data aggregated by this builder, and set itsBucketSettings.raw()representation as well.CompressionModecompressionMode()The different compression modes for the bucket.DefaultBucketSettings.BuildercompressionMode(CompressionMode compressionMode)Map<String,Object>customSettings()A map of map of advanced settings that are not covered by the native methods of the object but still need to be set when configuring a bucket.EjectionMethodejectionMethod()The ejection method available for the bucket.DefaultBucketSettings.BuilderejectionMethod(EjectionMethod ejectionMethod)booleanenableFlush()If flush is enabled.DefaultBucketSettings.BuilderenableFlush(boolean enableFlush)booleanindexReplicas()If replicas are indexed.DefaultBucketSettings.BuilderindexReplicas(boolean indexReplicas)Stringname()The name of the bucket.DefaultBucketSettings.Buildername(String name)Stringpassword()The password of the bucket.DefaultBucketSettings.Builderpassword(String password)intport()The optional proxy port.DefaultBucketSettings.Builderport(int port)intquota()The bucket quota.DefaultBucketSettings.Builderquota(int quota)JsonObjectraw()A raw representation of the bucket settings when acquired from the server.intreplicas()Number of replicas.DefaultBucketSettings.Builderreplicas(int replicas)BucketTypetype()The type of the bucket.DefaultBucketSettings.Buildertype(BucketType type)DefaultBucketSettings.BuilderwithSetting(String key, Object value)Add a custom setting to the bucket settings (ie.DefaultBucketSettings.BuilderwithSettings(Map<String,Object> customSettings)Add several custom settings to the bucket settings (ie.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Description copied from interface:BucketSettingsThe name of the bucket.- Specified by:
namein interfaceBucketSettings- Returns:
- name of the bucket.
-
name
-
type
Description copied from interface:BucketSettingsThe type of the bucket.- Specified by:
typein interfaceBucketSettings- Returns:
- type of the bucket.
-
type
-
quota
public int quota()Description copied from interface:BucketSettingsThe bucket quota.- Specified by:
quotain interfaceBucketSettings- Returns:
- bucket quota.
-
quota
-
port
public int port()Description copied from interface:BucketSettingsThe optional proxy port.- Specified by:
portin interfaceBucketSettings- Returns:
- proxy port.
-
port
-
password
Description copied from interface:BucketSettingsThe password of the bucket.- Specified by:
passwordin interfaceBucketSettings- Returns:
- password.
-
password
-
replicas
public int replicas()Description copied from interface:BucketSettingsNumber of replicas.- Specified by:
replicasin interfaceBucketSettings- Returns:
- number of replicas.
-
replicas
-
indexReplicas
public boolean indexReplicas()Description copied from interface:BucketSettingsIf replicas are indexed.- Specified by:
indexReplicasin interfaceBucketSettings- Returns:
- indexing replicas.
-
indexReplicas
-
enableFlush
public boolean enableFlush()Description copied from interface:BucketSettingsIf flush is enabled.- Specified by:
enableFlushin interfaceBucketSettings- Returns:
- flush enabled.
-
enableFlush
-
compressionMode
Description copied from interface:BucketSettingsThe different compression modes for the bucket.- Specified by:
compressionModein interfaceBucketSettings- Returns:
- the compression mode selected.
-
compressionMode
-
ejectionMethod
Description copied from interface:BucketSettingsThe ejection method available for the bucket.- Specified by:
ejectionMethodin interfaceBucketSettings- Returns:
- the ejection method selected.
-
ejectionMethod
-
customSettings
Description copied from interface:BucketSettingsA map of map of advanced settings that are not covered by the native methods of the object but still need to be set when configuring a bucket. To get a full raw representation of an existing bucket's configuration, seeBucketSettings.raw()instead.- Specified by:
customSettingsin interfaceBucketSettings- Returns:
- the map of custom advanced settings to use when configuring the bucket.
-
raw
Description copied from interface:BucketSettingsA raw representation of the bucket settings when acquired from the server. This can be used to get any missing information about the bucket that isn't covered by native methods. To configure a bucket and add settings that are not covered by native methods either, you should instead seeBucketSettings.customSettings().- Specified by:
rawin interfaceBucketSettings- Returns:
- the raw representation of the whole bucket settings, as returned by the server, or
an empty
JsonObjectif not applicable.
-
withSetting
Add a custom setting to the bucket settings (ie. one that is not covered by a native method).- Parameters:
key- the setting's key.value- the setting's value.- Returns:
- the Builder for chaining.
-
withSettings
Add several custom settings to the bucket settings (ie. settings not covered by a native method).- Parameters:
customSettings- the settings to add.- Returns:
- the Builder for chaining.
-
build
-
build
Build theBucketSettingsfrom the data aggregated by this builder, and set itsBucketSettings.raw()representation as well.- Parameters:
raw- the raw representation for the settings, from the server.- Returns:
- the new
BucketSettings.
-