public static class Text.Builder extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
myLanguage
The language to use when stemming the search terms.
|
protected int |
myLimit
Maximum number of document to return.
|
protected Document |
myQuery
A standard MongoDB query document to limit the final results.
|
protected ReadPreference |
myReadPreference
The read preference to use.
|
protected Document |
myReturnFields
The fields to return from the query.
|
protected String |
mySearchTerm
The search terms.
|
Constructor and Description |
---|
Text.Builder()
Creates a new Builder.
|
Modifier and Type | Method and Description |
---|---|
Text |
build()
Creates a new
Text based on the current state of the builder. |
Text.Builder |
language(String language)
Sets the language to use when stemming the search terms to the new
value.
|
Text.Builder |
limit(int limit)
Sets the maximum number of document to return to the new value.
|
Text.Builder |
query(DocumentAssignable query)
Sets the standard MongoDB query document to limit the final results
to the new value.
|
Text.Builder |
readPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the Text command. |
Text.Builder |
reset()
Resets the builder back to its initial state.
|
Text.Builder |
returnFields(DocumentAssignable returnFields)
Sets the fields to return from the query to the new value.
|
Text.Builder |
searchTerm(String searchTerm)
Sets the search term to the new value.
|
Text.Builder |
setLanguage(String language)
Sets the language to use when stemming the search terms to the new
value.
|
Text.Builder |
setLimit(int limit)
Sets the maximum number of document to return to the new value.
|
Text.Builder |
setQuery(DocumentAssignable query)
Sets the standard MongoDB query document to limit the final results
to the new value.
|
Text.Builder |
setReadPreference(ReadPreference readPreference)
Sets the
ReadPreference specifying which servers may be used
to execute the Text command. |
Text.Builder |
setReturnFields(DocumentAssignable returnFields)
Sets the fields to return from the query to the new value.
|
Text.Builder |
setSearchTerm(String searchTerm)
Sets the search term to the new value.
|
protected String myLanguage
protected int myLimit
protected Document myQuery
protected ReadPreference myReadPreference
protected Document myReturnFields
protected String mySearchTerm
public Text build()
Text
based on the current state of the builder.Text
based on the current state of the builder.IllegalArgumentException
- On the search term not being set.public Text.Builder language(String language)
This method delegates to setLanguage(String)
language
- The new value for the language to use when stemming the
search terms.Text.Builder
for method call chaining.public Text.Builder limit(int limit)
This method delegates to setLimit(int)
limit
- The new value for the maximum number of document to
return.Text.Builder
for method call chaining.public Text.Builder query(DocumentAssignable query)
This method delegates to setQuery(DocumentAssignable)
query
- The new value for the standard MongoDB query document to
limit the final results.Text.Builder
for method call chaining.public Text.Builder readPreference(ReadPreference readPreference)
ReadPreference
specifying which servers may be used
to execute the Text
command.
If not set or set to null
then the
MongoCollection
instance's ReadPreference
will be
used.
This method delegates to setReadPreference(ReadPreference)
.
readPreference
- The read preferences specifying which servers may be used.MongoCollection.getReadPreference()
public Text.Builder reset()
Text.Builder
for method call chaining.public Text.Builder returnFields(DocumentAssignable returnFields)
This method delegates to setReturnFields(DocumentAssignable)
returnFields
- The new value for the fields to return from the query.Text.Builder
for method call chaining.public Text.Builder searchTerm(String searchTerm)
This method delegates to setSearchTerm(String)
searchTerm
- The new value for the search terms.Text.Builder
for method call chaining.public Text.Builder setLanguage(String language)
language
- The new value for the language to use when stemming the
search terms.Text.Builder
for method call chaining.public Text.Builder setLimit(int limit)
limit
- The new value for the maximum number of document to
return.Text.Builder
for method call chaining.public Text.Builder setQuery(DocumentAssignable query)
query
- The new value for the standard MongoDB query document to
limit the final results.Text.Builder
for method call chaining.public Text.Builder setReadPreference(ReadPreference readPreference)
ReadPreference
specifying which servers may be used
to execute the Text
command.
If not set or set to null
then the
MongoCollection
instance's ReadPreference
will be
used.
readPreference
- The read preferences specifying which servers may be used.MongoCollection.getReadPreference()
public Text.Builder setReturnFields(DocumentAssignable returnFields)
returnFields
- The new value for the fields to return from the query.Text.Builder
for method call chaining.public Text.Builder setSearchTerm(String searchTerm)
searchTerm
- The new value for the search terms.Text.Builder
for method call chaining.Copyright © 2011-2013 Allanbank Consulting, Inc.. All Rights Reserved.