Skip to content

Commit 8ec8b97

Browse files
committed
Improve doc of custom codec
- Correct parameter interface from `Parameter` to `MySqlParameter` - Override `toString()` in the implementation of `MySqlParameter`
1 parent 122dcf1 commit 8ec8b97

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public final class JacksonCodec implements Codec<Object> {
455455
return encoding;
456456
}
457457

458-
private static final class JacksonParameter implements Parameter {
458+
private static final class JacksonParameter implements MySqlParameter {
459459

460460
private final ByteBufAllocator allocator;
461461

@@ -524,6 +524,14 @@ public final class JacksonCodec implements Codec<Object> {
524524
public short getType() {
525525
return DataTypes.VARCHAR;
526526
}
527+
528+
/**
529+
* Optional, for statements/parameters logging.
530+
*/
531+
@Override
532+
public String toString() {
533+
return value.toString();
534+
}
527535
}
528536
}
529537
```

src/main/java/io/asyncer/r2dbc/mysql/codec/NullMySqlParameter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public void dispose() {
6565

6666
@Override
6767
public String toString() {
68-
// Hide parameter detail even it is null.
6968
return "null";
7069
}
7170

0 commit comments

Comments
 (0)