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 DefaultBucketSettings
build()
DefaultBucketSettings
build(JsonObject raw)
Build theBucketSettings
from the data aggregated by this builder, and set itsBucketSettings.raw()
representation as well.CompressionMode
compressionMode()
The different compression modes for the bucket.DefaultBucketSettings.Builder
compressionMode(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.EjectionMethod
ejectionMethod()
The ejection method available for the bucket.DefaultBucketSettings.Builder
ejectionMethod(EjectionMethod ejectionMethod)
boolean
enableFlush()
If flush is enabled.DefaultBucketSettings.Builder
enableFlush(boolean enableFlush)
boolean
indexReplicas()
If replicas are indexed.DefaultBucketSettings.Builder
indexReplicas(boolean indexReplicas)
String
name()
The name of the bucket.DefaultBucketSettings.Builder
name(String name)
String
password()
The password of the bucket.DefaultBucketSettings.Builder
password(String password)
int
port()
The optional proxy port.DefaultBucketSettings.Builder
port(int port)
int
quota()
The bucket quota.DefaultBucketSettings.Builder
quota(int quota)
JsonObject
raw()
A raw representation of the bucket settings when acquired from the server.int
replicas()
Number of replicas.DefaultBucketSettings.Builder
replicas(int replicas)
BucketType
type()
The type of the bucket.DefaultBucketSettings.Builder
type(BucketType type)
DefaultBucketSettings.Builder
withSetting(String key, Object value)
Add a custom setting to the bucket settings (ie.DefaultBucketSettings.Builder
withSettings(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:BucketSettings
The name of the bucket.- Specified by:
name
in interfaceBucketSettings
- Returns:
- name of the bucket.
-
name
-
type
Description copied from interface:BucketSettings
The type of the bucket.- Specified by:
type
in interfaceBucketSettings
- Returns:
- type of the bucket.
-
type
-
quota
public int quota()Description copied from interface:BucketSettings
The bucket quota.- Specified by:
quota
in interfaceBucketSettings
- Returns:
- bucket quota.
-
quota
-
port
public int port()Description copied from interface:BucketSettings
The optional proxy port.- Specified by:
port
in interfaceBucketSettings
- Returns:
- proxy port.
-
port
-
password
Description copied from interface:BucketSettings
The password of the bucket.- Specified by:
password
in interfaceBucketSettings
- Returns:
- password.
-
password
-
replicas
public int replicas()Description copied from interface:BucketSettings
Number of replicas.- Specified by:
replicas
in interfaceBucketSettings
- Returns:
- number of replicas.
-
replicas
-
indexReplicas
public boolean indexReplicas()Description copied from interface:BucketSettings
If replicas are indexed.- Specified by:
indexReplicas
in interfaceBucketSettings
- Returns:
- indexing replicas.
-
indexReplicas
-
enableFlush
public boolean enableFlush()Description copied from interface:BucketSettings
If flush is enabled.- Specified by:
enableFlush
in interfaceBucketSettings
- Returns:
- flush enabled.
-
enableFlush
-
compressionMode
Description copied from interface:BucketSettings
The different compression modes for the bucket.- Specified by:
compressionMode
in interfaceBucketSettings
- Returns:
- the compression mode selected.
-
compressionMode
-
ejectionMethod
Description copied from interface:BucketSettings
The ejection method available for the bucket.- Specified by:
ejectionMethod
in interfaceBucketSettings
- Returns:
- the ejection method selected.
-
ejectionMethod
-
customSettings
Description copied from interface:BucketSettings
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. To get a full raw representation of an existing bucket's configuration, seeBucketSettings.raw()
instead.- Specified by:
customSettings
in interfaceBucketSettings
- Returns:
- the map of custom advanced settings to use when configuring the bucket.
-
raw
Description copied from interface:BucketSettings
A 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:
raw
in interfaceBucketSettings
- Returns:
- the raw representation of the whole bucket settings, as returned by the server, or
an empty
JsonObject
if 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 theBucketSettings
from 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
.
-