Class CollectionSpec
java.lang.Object
com.couchbase.client.java.manager.collection.CollectionSpec
The 
CollectionSpec describes properties of a collection that can be managed.- 
Field SummaryFieldsModifier 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 SummaryModifier 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_BUCKETA 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_EXPIREA 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- 
createCreates a newCollectionSpecusing the default scope.- Parameters:
- name- the name of the collection.
- Returns:
- the created CollectionSpec.
 
- 
createCreates a newCollectionSpecwith default properties.- Parameters:
- name- the name of the collection.
- scopeName- the name of the parent scope.
- Returns:
- the created CollectionSpec.
 
- 
createCreates 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.
 
- 
createCreates 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.
 
- 
nameThe name of the collection.
- 
scopeNameThe name of the parent scope.
- 
maxExpiryThe max expiry for documents in this collection, or a non-positive duration indicating special expiry behavior.- See Also:
 
- 
historywhether history retention is enabled on this collection.
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
 
-