All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wandoulabs.nedis.protocol.ListsCommands Maven / Gradle / Ivy

/**
 * Copyright (c) 2015 Wandoujia Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.wandoulabs.nedis.protocol;

import io.netty.util.concurrent.Future;

import java.nio.charset.StandardCharsets;
import java.util.List;

/**
 * @author zhangduo
 * @see http://redis.io/commands#list
 */
public interface ListsCommands extends BlockingListsCommands {

    Future lindex(byte[] key, long index);

    public enum LIST_POSITION {
        BEFORE, AFTER;
        public final byte[] raw;

        private LIST_POSITION() {
            raw = name().getBytes(StandardCharsets.UTF_8);
        }
    }

    Future linsert(byte[] key, LIST_POSITION where, byte[] pivot, byte[] value);

    Future llen(byte[] key);

    Future lpop(byte[] key);

    Future lpush(byte[] key, byte[]... values);

    Future lpushx(byte[] key, byte[] value);

    Future> lrange(byte[] key, long startInclusive, long stopInclusive);

    Future lrem(byte[] key, long count, byte[] value);

    Future lset(byte[] key, long index, byte[] value);

    Future ltrim(byte[] key, long startInclusive, long stopInclusive);

    Future rpop(byte[] key);

    Future rpoplpush(byte[] src, byte[] dst);

    Future rpush(byte[] key, byte[]... values);

    Future rpushx(byte[] key, byte[] value);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy