Class CollectionSpec
java.lang.Object
com.couchbase.client.java.manager.collection.CollectionSpec
The
CollectionSpec
describes properties of a collection that can be managed.-
Field Summary
Modifier and TypeFieldDescriptionstatic final Duration
A special collection "max expiry" value that means documents in the collection never expire, regardless of the bucket's max expiry setting.static final Duration
A special collection "max expiry" value that means the collection's max expiry is always the same as the bucket's max expiry. -
Method Summary
Modifier and TypeMethodDescriptionstatic CollectionSpec
Creates a newCollectionSpec
using the default scope.static CollectionSpec
Creates a newCollectionSpec
with default properties.static CollectionSpec
Creates a newCollectionSpec
with a custom max expiry.static CollectionSpec
Creates a newCollectionSpec
with a custom max expiry on the default scope.boolean
int
hashCode()
history()
whether history retention is enabled on this collection.protected static CollectionSpec
internalCreate
(String name, String scopeName, Duration maxExpiry, Boolean history) Creates a newCollectionSpec
with a custom max expiry.The max expiry for documents in this collection, or a non-positive duration indicating special expiry behavior.name()
The name of the collection.The name of the parent scope.toString()
-
Field Details
-
SAME_EXPIRY_AS_BUCKET
A special collection "max expiry" value that means the collection's max expiry is always the same as the bucket's max expiry.Use the bucket management API to discover the actual expiry value.
-
NEVER_EXPIRE
A special collection "max expiry" value that means documents in the collection never expire, regardless of the bucket's max expiry setting.Requires Couchbase Server 7.6 or later.
-
-
Method Details
-
create
Creates a newCollectionSpec
using the default scope.- Parameters:
name
- the name of the collection.- Returns:
- the created
CollectionSpec
.
-
create
Creates a newCollectionSpec
with default properties.- Parameters:
name
- the name of the collection.scopeName
- the name of the parent scope.- Returns:
- the created
CollectionSpec
.
-
create
Creates a newCollectionSpec
with a custom max expiry on the default scope.- Parameters:
name
- the name of the collection.maxExpiry
- the maximum expiry (ttl) to use for this collection.- Returns:
- the created
CollectionSpec
.
-
create
Creates a newCollectionSpec
with a custom max expiry.- Parameters:
name
- the name of the collection.scopeName
- the name of the parent scope.maxExpiry
- the maximum expiry (ttl) to use for this collection.- Returns:
- the created
CollectionSpec
.
-
internalCreate
@Volatile @Internal protected static CollectionSpec internalCreate(String name, String scopeName, Duration maxExpiry, Boolean history) Creates a newCollectionSpec
with a custom max expiry.- Parameters:
name
- the name of the collection.scopeName
- the name of the parent scope.maxExpiry
- the maximum expiry (ttl) to use for this collection.history
- whether history retention is enabled on this collection.- Returns:
- the created
CollectionSpec
.
-
name
The name of the collection. -
scopeName
The name of the parent scope. -
maxExpiry
The max expiry for documents in this collection, or a non-positive duration indicating special expiry behavior.- See Also:
-
history
whether history retention is enabled on this collection. -
toString
-
equals
-
hashCode
public int hashCode()
-