public static class Count.Builder extends Object
Count
queries.Modifier and Type | Field and Description |
---|---|
protected long |
myMaximumTimeMilliseconds
The maximum amount of time to allow the query to run.
|
protected Document |
myQuery
The query document.
|
protected ReadPreference |
myReadPreference
The preference for which servers to use to retrieve the results.
|
Constructor and Description |
---|
Count.Builder()
Creates a new Builder.
|
Count.Builder(DocumentAssignable query)
Creates a new Builder.
|
Modifier and Type | Method and Description |
---|---|
Count |
build()
Constructs a new
Count object from the state of the builder. |
Count.Builder |
maximumTime(long timeLimit,
TimeUnit timeLimitUnits)
Sets the maximum number of milliseconds to allow the query to run
before aborting the request on the server.
|
Count.Builder |
query(DocumentAssignable query)
Sets the value of the query document to the new value.
|
Count.Builder |
readPreference(ReadPreference readPreference)
Sets the preference for the set of servers to retrieve the results
from.
|
Count.Builder |
reset()
Resets the builder back to its initial state for reuse.
|
Count.Builder |
setMaximumTimeMilliseconds(long maximumTimeMilliseconds)
Sets the maximum number of milliseconds to allow the query to run
before aborting the request on the server.
|
Count.Builder |
setQuery(DocumentAssignable query)
Sets the value of the query document to the new value.
|
Count.Builder |
setReadPreference(ReadPreference readPreference)
Sets the preference for the set of servers to retrieve the results
from.
|
protected long myMaximumTimeMilliseconds
protected Document myQuery
protected ReadPreference myReadPreference
public Count.Builder()
public Count.Builder(DocumentAssignable query)
query
- The query document.public Count build()
Count
object from the state of the builder.Count
object.public Count.Builder maximumTime(long timeLimit, TimeUnit timeLimitUnits)
This method equivalent to setMaximumTimeMilliseconds(timeLimitUnits.toMillis(timeLimit)
.
timeLimit
- The new maximum amount of time to allow the query to run.timeLimitUnits
- The units for the maximum amount of time to allow the
query to run.Count.Builder
for method call chaining.public Count.Builder query(DocumentAssignable query)
This method delegates to setQuery(DocumentAssignable)
.
query
- The new value for the query document.public Count.Builder readPreference(ReadPreference readPreference)
This method delegates to setReadPreference(ReadPreference)
.
readPreference
- The new value for the preference of which server to return
the results from.public Count.Builder reset()
public Count.Builder setMaximumTimeMilliseconds(long maximumTimeMilliseconds)
maximumTimeMilliseconds
- The new maximum number of milliseconds to allow the query
to run.Count.Builder
for method call chaining.public Count.Builder setQuery(DocumentAssignable query)
query
- The new value for the query document.public Count.Builder setReadPreference(ReadPreference readPreference)
readPreference
- The new value for the preference of which server to return
the results from.Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.