| Total Complexity | 4 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | package io.mcarle.sciurus.cache.redis; |
||
| 8 | 1 | public class RedisJsonCodec implements RedisCodec<String, RedisData> { |
|
| 9 | |||
| 10 | @Override |
||
| 11 | public String decodeKey(final ByteBuffer bytes) { |
||
| 12 | 1 | return StandardCharsets.UTF_8.decode(bytes).toString(); |
|
| 13 | } |
||
| 14 | |||
| 15 | @Override |
||
| 16 | public RedisData decodeValue(final ByteBuffer bytes) { |
||
| 17 | 1 | return RedisData.fromByteBuffer(bytes); |
|
| 18 | } |
||
| 19 | |||
| 20 | @Override |
||
| 21 | public ByteBuffer encodeKey(final String key) { |
||
| 22 | 1 | return StandardCharsets.UTF_8.encode(key); |
|
| 23 | } |
||
| 24 | |||
| 25 | @Override |
||
| 26 | public ByteBuffer encodeValue(final RedisData value) { |
||
| 27 | 1 | return RedisData.toByteBuffer(value); |
|
| 28 | } |
||
| 30 |