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

org.redisson.api.RCollectionAsync Maven / Gradle / Ivy

Go to download

Easy Redis Java client and Real-Time Data Platform. Valkey compatible. Sync/Async/RxJava3/Reactive API. Client side caching. Over 50 Redis based Java objects and services: JCache API, Apache Tomcat, Hibernate, Spring, Set, Multimap, SortedSet, Map, List, Queue, Deque, Semaphore, Lock, AtomicLong, Map Reduce, Bloom filter, Scheduler, RPC

The newest version!
/**
 * Copyright (c) 2013-2024 Nikita Koksharov
 *
 * 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 org.redisson.api;

import java.util.Collection;

/**
 * Common async interface for collection object
 * 
 * @author Nikita Koksharov
 *
 * @param  type of value
 */
public interface RCollectionAsync extends RExpirableAsync {

    /**
     * Retains only the elements in this collection that are contained in the
     * specified collection.
     *
     * @param c collection containing elements to be retained in this collection
     * @return true if this collection changed as a result of the call
     */
    RFuture retainAllAsync(Collection c);

    /**
     * Removes all of this collection's elements that are also contained in the
     * specified collection.
     *
     * @param c collection containing elements to be removed from this collection
     * @return true if this collection changed as a result of the
     *         call
     */
    RFuture removeAllAsync(Collection c);

    /**
     * Returns true if this collection contains encoded state of the specified element.
     *
     * @param o element whose presence in this collection is to be tested
     * @return true if this collection contains the specified
     *         element and false otherwise
     */
    RFuture containsAsync(Object o);

    /**
     * Returns true if this collection contains all of the elements
     * in the specified collection.
     *
     * @param  c collection to be checked for containment in this collection
     * @return true if this collection contains all of the elements
     *         in the specified collection
     */
    RFuture containsAllAsync(Collection c);

    /**
     * Removes a single instance of the specified element from this
     * collection, if it is present.
     *
     * @param o element to be removed from this collection, if present
     * @return true if an element was removed as a result of this call
     */
    RFuture removeAsync(Object o);

    /**
     * Returns number of elements in this collection.
     *
     * @return size of collection
     */
    RFuture sizeAsync();

    /**
     * Adds element into this collection.
     * 
     * @param e - element to add
     * @return true if an element was added 
     *          and false if it is already present
     */
    RFuture addAsync(V e);

    /**
     * Adds all elements contained in the specified collection
     * 
     * @param c - collection of elements to add
     * @return true if at least one element was added 
     *          and false if all elements are already present
     */
    RFuture addAllAsync(Collection c);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy