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
FieldsModifier and TypeFieldDescriptionstatic final DurationA special collection "max expiry" value that means documents in the collection never expire, regardless of the bucket's max expiry setting.static final DurationA 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 CollectionSpecCreates a newCollectionSpecusing the default scope.static CollectionSpecCreates a newCollectionSpecwith default properties.static CollectionSpecCreates a newCollectionSpecwith a custom max expiry.static CollectionSpecCreates a newCollectionSpecwith a custom max expiry on the default scope.booleaninthashCode()history()whether history retention is enabled on this collection.protected static CollectionSpecinternalCreate(String name, String scopeName, Duration maxExpiry, Boolean history) Creates a newCollectionSpecwith 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 newCollectionSpecusing the default scope.- Parameters:
name- the name of the collection.- Returns:
- the created
CollectionSpec.
-
create
Creates a newCollectionSpecwith default properties.- Parameters:
name- the name of the collection.scopeName- the name of the parent scope.- Returns:
- the created
CollectionSpec.
-
create
Creates a newCollectionSpecwith 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 newCollectionSpecwith 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 newCollectionSpecwith 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()
-