public class CollectionOptions extends Object
Constructor and Description |
---|
CollectionOptions(Long size,
Long maxDocuments,
Boolean capped)
Deprecated.
since 2.0 please use
empty() as entry point. |
Modifier and Type | Method and Description |
---|---|
CollectionOptions |
capped()
Create new
CollectionOptions with already given settings and capped set to true. |
CollectionOptions |
collation(Collation collation)
Create new
CollectionOptions with already given settings and collation set to given value. |
static CollectionOptions |
empty()
Create new empty
CollectionOptions . |
Optional<Boolean> |
getCapped()
Get if the collection should be capped.
|
Optional<Collation> |
getCollation()
Get the
Collation settings. |
Optional<Long> |
getMaxDocuments()
Get the max number of documents the collection should be limited to.
|
Optional<Long> |
getSize()
Get the size in bytes the collection should be limited to.
|
static CollectionOptions |
just(Collation collation)
Create new
CollectionOptions by just providing the Collation to use. |
CollectionOptions |
maxDocuments(long maxDocuments)
Create new
CollectionOptions with already given settings and maxDocuments set to given value. |
CollectionOptions |
size(long size)
Create new
CollectionOptions with already given settings and size set to given value. |
@Deprecated public CollectionOptions(@Nullable Long size, @Nullable Long maxDocuments, @Nullable Boolean capped)
empty()
as entry point.CollectionOptions
instance.size
- the collection size in bytes, this data space is preallocated. Can be null.maxDocuments
- the maximum number of documents in the collection. Can be null.capped
- true to created a "capped" collection (fixed size with auto-FIFO behavior based on insertion order),
false otherwise. Can be null.public static CollectionOptions just(Collation collation)
CollectionOptions
by just providing the Collation
to use.collation
- must not be null.CollectionOptions
.public static CollectionOptions empty()
CollectionOptions
.CollectionOptions
.public CollectionOptions capped()
CollectionOptions
with already given settings and capped set to true. #size(int)
.CollectionOptions
.public CollectionOptions maxDocuments(long maxDocuments)
CollectionOptions
with already given settings and maxDocuments
set to given value.maxDocuments
- can be null.CollectionOptions
.public CollectionOptions size(long size)
CollectionOptions
with already given settings and size
set to given value.size
- can be null.CollectionOptions
.public CollectionOptions collation(@Nullable Collation collation)
CollectionOptions
with already given settings and collation
set to given value.collation
- can be null.CollectionOptions
.public Optional<Long> getMaxDocuments()
Optional.empty()
if not set.public Optional<Long> getSize()
Optional.empty()
if not set.public Optional<Boolean> getCapped()
Optional.empty()
if not set.public Optional<Collation> getCollation()
Collation
settings.Optional.empty()
if not set.Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.