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 17, 2024
1 parent 9bf02ce commit 93ffaba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,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 @@ -523,6 +523,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 @@ -103,7 +103,7 @@ default void encodeStringify() {

@Test
default void encodedToString() {
Codec<T> codec = getCodec(UnpooledByteBufAllocator.DEFAULT);
Codec<T> codec = getCodec();
T[] origin = originParameters();

for (T t : origin) {
Expand Down

0 comments on commit 93ffaba

Please sign in to comment.