Interface ToByteBufEncoder<K,​V>

    • Method Detail

      • encodeKey

        void encodeKey​(K key,
                       ByteBuf target)
        Encode the key for output to redis.
        Parameters:
        key - the key, may be null.
        target - the target buffer, must not be null.
      • encodeValue

        void encodeValue​(V value,
                         ByteBuf target)
        Encode the value for output to redis.
        Parameters:
        value - the value, may be null.
        target - the target buffer, must not be null.
      • estimateSize

        int estimateSize​(Object keyOrValue)
        Estimates the size of the resulting byte stream. This method is called for keys and values to estimate the size for the temporary buffer to allocate.
        Parameters:
        keyOrValue - the key or value, may be null.
        Returns:
        the estimated number of bytes in the encoded representation.
      • isEstimateExact

        default boolean isEstimateExact()
        Returns true if estimateSize(Object) returns exact size This is used as an optimization to reduce memory allocations when encoding data.
        Returns:
        true if estimateSize(Object) returns exact size.
        Since:
        6.3.2