class ScoredValueScanStreamingOutput<K, V> extends ScanOutput<K, V, StreamScanCursor> {

    private final ScoredValueStreamingChannel<V> channel;

    private V value;

    private boolean hasValue;

    public ScoredValueScanStreamingOutput(RedisCodec<K, V> codec, ScoredValueStreamingChannel<V> channel) {
        super(codec, new StreamScanCursor());
        this.channel = channel;
    }

    @Override
    protected void setOutput(ByteBuffer bytes) {
        if (!hasValue) {
            value = codec.decodeValue(bytes);
            hasValue = true;
            return;
        }

        double score = LettuceStrings.toDouble(decodeAscii(bytes));
        set(score);
    }

    @Override
    public void set(double number) {<FILL_FUNCTION_BODY>}

}


        if (hasValue) {
            channel.onValue(ScoredValue.just(number, value));
        }

        output.setCount(output.getCount() + 1);
        value = null;
        hasValue = false;
    
<methods>public void <init>(RedisCodec<K,V>, io.lettuce.core.StreamScanCursor) ,public void set(java.nio.ByteBuffer) <variables>