Skip to content

Commit

Permalink
Make Utf8StringNewlineStrategy class open (#366)
Browse files Browse the repository at this point in the history
Make Utf8StringNewlineStrategy class open so that clients can extend the
class and apply custom transformations.

For example:
```kotlin
class MyRecordStrategy() : Utf8StringNewlineStrategy(ignoreBlankLines = true) {
  override fun calculateNextRecordBytes =
    super.calculateNextRecordBytes(source).map(String::uppercase)
}

```
  • Loading branch information
elmerland authored Jan 10, 2024
1 parent 5be9fdf commit 8902361
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import okio.ByteString
/**
* Produces single string records separated by newlines.
*/
class Utf8StringNewlineStrategy(
open class Utf8StringNewlineStrategy(
private val ignoreBlankLines: Boolean = true,
) : RecordStrategy<String> {
override fun calculateNextRecordBytes(source: BufferedSource): Long {
Expand Down

0 comments on commit 8902361

Please sign in to comment.