Skip to content

Commit cf6287c

Browse files
committed
Update README
Signed-off-by: Stefano Cordio <[email protected]>
1 parent ef40f3c commit cf6287c

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

spring-batch-notion/README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This project provides a [Spring Batch][] extension module that adds support for
66

77
## Compatibility
88

9-
Spring Batch Notion is based on Spring Batch 5 and tested on Spring Boot 3, thus requiring at least Java 17.
9+
Spring Batch Notion is based on Spring Batch 6 and tested on Spring Boot 4, thus requiring at least Java 17.
1010

1111
Compatibility is guaranteed only with the Spring Batch versions under [OSS support](https://spring.io/projects/spring-batch#support).
1212

@@ -36,25 +36,29 @@ A minimal configuration of the item reader is as follows:
3636

3737
```java
3838
NotionDatabaseItemReader<Item> itemReader() {
39-
NotionDatabaseItemReader<Item> reader = new NotionDatabaseItemReader<>();
40-
reader.setToken(System.getenv("NOTION_TOKEN"));
41-
reader.setDatabaseId("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"); // UUID
42-
reader.setPropertiesMapper(new CustomPropertyMapper());
43-
return reader;
39+
String token = System.getenv("NOTION_TOKEN");
40+
String databaseId = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"; // UUID
41+
PropertyMapper<Item> propertyMapper = new CustomPropertyMapper();
42+
return new NotionDatabaseItemReader<>(token, databaseId, propertyMapper);
4443
}
4544
```
4645

47-
The following configuration options are available:
46+
The following constructor parameters should be provided:
47+
48+
| Property | Description |
49+
|------------------|---------------------------------------------------------------------------------------------------------------------------|
50+
| `token` | The Notion integration token. |
51+
| `databaseId` | UUID of the database to read from. |
52+
| `propertyMapper` | The `PropertyMapper` responsible for mapping properties of a Notion item into a Java object. |
53+
54+
and the following configuration options are available:
4855

4956
| Property | Required | Default | Description |
5057
|------------------|----------|-----------------------------|---------------------------------------------------------------------------------------------------------------------------|
5158
| `baseUrl` | no | `https://api.notion.com/v1` | Base URL of the Notion API. A custom value can be provided for testing purposes (e.g., the URL of a [WireMock][] server). |
52-
| `databaseId` | yes | - | UUID of the database to read from. |
5359
| `filter` | no | `null` | `Filter` condition to limit the returned items. |
5460
| `pageSize` | no | `100` | Number of items to be read with each page. Must be greater than zero and less than or equal to 100. |
55-
| `propertyMapper` | yes | - | The `PropertyMapper` responsible for mapping properties of a Notion item into a Java object. |
5661
| `sorts` | no | `null` | `Sort` conditions to order the returned items. Each condition is applied following the declaration order. |
57-
| `token` | yes | - | The Notion integration token. |
5862

5963
In addition to the Notion-specific configuration, all the configuration options of the Spring Batch
6064
[`AbstractPaginatedDataItemReader`](https://docs.spring.io/spring-batch/docs/current/api/org/springframework/batch/item/data/AbstractPaginatedDataItemReader.html)

spring-batch-notion/src/main/java/org/springframework/batch/extensions/notion/NotionDatabaseItemReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ public class NotionDatabaseItemReader<T> extends AbstractPaginatedDataItemReader
8585
* Create a new {@link NotionDatabaseItemReader}.
8686
* @param token the Notion integration token
8787
* @param databaseId UUID of the database to read from
88-
* @param propertyMapper the {@link PropertyMapper} responsible for mapping Notion
89-
* item properties into a Java object
88+
* @param propertyMapper the {@link PropertyMapper} responsible for mapping properties
89+
* of a Notion item into a Java object
9090
*/
9191
public NotionDatabaseItemReader(String token, String databaseId, PropertyMapper<T> propertyMapper) {
9292
this.token = Objects.requireNonNull(token);

0 commit comments

Comments
 (0)