codec/RedisCodec.java

lettuce · src/main/java/io/lettuce/core/codec/RedisCodec.java · java · MIT
database

Interface for encoding/decoding Redis keys and values in the Lettuce client library.

// Source: https://github.com/redis/lettuce | License: MIT | Copyright 2023-Present, Redis Ltd
// Provided via justclaw.it.com; keep this notice with the code.
package io.lettuce.core.codec;

import java.nio.ByteBuffer;

/**
 * A {@link RedisCodec} encodes keys and values sent to Redis, and decodes keys and values in the command output.
 *
 * The methods are called by multiple threads and must be thread-safe.
 *
 * <h3>Type semantics</h3>
 * <p>
 * {@code K} represents a Redis key (or a hash field of such a key) routed through {@link #encodeKey(Object)} /
 * {@link #decodeKey(ByteBuffer)}.
 * </p>
 * <p>
 * {@code V} represents a value that is stored under a Redis key (or under a hash field of such a key) and that the server
 * returns as opaque bytes; values round-trip through {@link #enc

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key