Skip to content

Commit

Permalink
Improve doc of custom codec
Browse files Browse the repository at this point in the history
- Correct parameter interface from `Parameter` to `MySqlParameter`
- Override `toString()` in the implementation of `MySqlParameter`
  • Loading branch information
mirromutth committed Jan 23, 2024
1 parent 122dcf1 commit 8ec8b97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ public final class JacksonCodec implements Codec<Object> {
return encoding;
}

private static final class JacksonParameter implements Parameter {
private static final class JacksonParameter implements MySqlParameter {

private final ByteBufAllocator allocator;

Expand Down Expand Up @@ -524,6 +524,14 @@ public final class JacksonCodec implements Codec<Object> {
public short getType() {
return DataTypes.VARCHAR;
}

/**
* Optional, for statements/parameters logging.
*/
@Override
public String toString() {
return value.toString();
}
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public void dispose() {

@Override
public String toString() {
// Hide parameter detail even it is null.
return "null";
}

Expand Down

0 comments on commit 8ec8b97

Please sign in to comment.