class MetricsDataRedisCodec implements RedisCodec<String, CollectRep.MetricsData> {

    @Override
    public String decodeKey(ByteBuffer byteBuffer) {
        return StandardCharsets.UTF_8.decode(byteBuffer).toString();
    }

    @Override
    public CollectRep.MetricsData decodeValue(ByteBuffer byteBuffer) {<FILL_FUNCTION_BODY>}

    @Override
    public ByteBuffer encodeKey(String s) {
        return ByteBuffer.wrap(s.getBytes(StandardCharsets.UTF_8));
    }

    @Override
    public ByteBuffer encodeValue(CollectRep.MetricsData metricsData) {
        return ByteBuffer.wrap(metricsData.toByteArray());
    }
}

        try {
            return CollectRep.MetricsData.parseFrom(byteBuffer);
        } catch (Exception e) {
            log.error(e.getMessage());
            return null;
        }
    
<no_super_class>