Skip to content

Commit 5e51547

Browse files
santfiraxfmbenhassine
authored andcommitted
Add getters for collection and mode in MongoItemWriter
Resolves #3973
1 parent 83b2a2a commit 5e51547

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/MongoItemWriter.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,15 @@ public void setMode(final Mode mode) {
121121
this.mode = mode;
122122
}
123123

124+
/**
125+
* Get the operating {@link Mode} of the item writer.
126+
* @return the operating mode
127+
* @since 5.1
128+
*/
129+
public Mode getMode() {
130+
return mode;
131+
}
132+
124133
/**
125134
* Set the {@link MongoOperations} to be used to save items to be written.
126135
* @param template the template implementation to be used.
@@ -146,6 +155,15 @@ public void setCollection(String collection) {
146155
this.collection = collection;
147156
}
148157

158+
/**
159+
* Get the Mongo collection name.
160+
* @return the collection name
161+
* @since 5.1
162+
*/
163+
public String getCollection() {
164+
return collection;
165+
}
166+
149167
/**
150168
* If a transaction is active, buffer items to be written just before commit.
151169
* Otherwise write items using the provided template.

0 commit comments

Comments
 (0)