// Copyright (C) 2011 - Will Glozer. All rights reserved.
package com.lambdaworks.redis.output;
import com.lambdaworks.redis.codec.RedisCodec;
import com.lambdaworks.redis.protocol.CommandOutput;
import java.nio.ByteBuffer;
import java.util.HashSet;
import java.util.Set;
/**
* {@link Set} of value output.
*
* @param <V> Value type.
*
* @author Will Glozer
*/
public class ValueSetOutput<K, V> extends CommandOutput<K, V, Set<V>> {
public ValueSetOutput(RedisCodec<K, V> codec) {
super(codec, new HashSet<V>());
}
@Override
public void set(ByteBuffer bytes) {
output.add(bytes == null ? null : codec.decodeValue(bytes));
}
}