类 MongoItemWriterBuilder<T>
- java.lang.Object
- org.springframework.batch.item.data.builder.MongoItemWriterBuilder<T>
public class MongoItemWriterBuilder<T> extends java.lang.Object
A builder implementation for theMongoItemWriter
- 从以下版本开始:
- 4.0
- 作者:
- Glenn Renfro
- 另请参阅:
MongoItemWriter
构造器概要
构造器 构造器 说明 MongoItemWriterBuilder()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 MongoItemWriter<T>
build()
Validates and builds aMongoItemWriter
.MongoItemWriterBuilder<T>
collection(java.lang.String collection)
Set the name of the Mongo collection to be written to.MongoItemWriterBuilder<T>
delete(boolean delete)
Indicates if the items being passed to the writer are to be saved or removed from the data store.MongoItemWriterBuilder<T>
template(org.springframework.data.mongodb.core.MongoOperations template)
Set theMongoOperations
to be used to save items to be written.
构造器详细资料
MongoItemWriterBuilder
public MongoItemWriterBuilder()
方法详细资料
delete
public MongoItemWriterBuilder<T> delete(boolean delete)
Indicates if the items being passed to the writer are to be saved or removed from the data store. If set to false (default), the items will be saved. If set to true, the items will be removed.- 参数:
delete
- removal indicator- 返回:
- The current instance of the builder
- 另请参阅:
MongoItemWriter.setDelete(boolean)
template
public MongoItemWriterBuilder<T> template(org.springframework.data.mongodb.core.MongoOperations template)
Set theMongoOperations
to be used to save items to be written.- 参数:
template
- the template implementation to be used.- 返回:
- The current instance of the builder
- 另请参阅:
MongoItemWriter.setTemplate(MongoOperations)
collection
public MongoItemWriterBuilder<T> collection(java.lang.String collection)
Set the name of the Mongo collection to be written to.- 参数:
collection
- the name of the collection.- 返回:
- The current instance of the builder
- 另请参阅:
MongoItemWriter.setCollection(String)
build
public MongoItemWriter<T> build()
Validates and builds aMongoItemWriter
.- 返回:
- a
MongoItemWriter