com.lambdaworks.redis.output.BooleanOutput Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redisson Show documentation
Show all versions of redisson Show documentation
Redis Java client with features of In-Memory Data Grid
// 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;
/**
* Boolean output. The actual value is returned as an integer
* where 0 indicates false and 1 indicates true, or as a null
* bulk reply for script output.
*
* @author Will Glozer
*/
public class BooleanOutput extends CommandOutput {
public BooleanOutput(RedisCodec codec) {
super(codec, null);
}
@Override
public void set(long integer) {
output = (integer == 1) ? Boolean.TRUE : Boolean.FALSE;
}
@Override
public void set(ByteBuffer bytes) {
output = (bytes != null) ? Boolean.TRUE : Boolean.FALSE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy