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

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

There is a newer version: 3.40.2
Show 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;

import org.reactivestreams.Publisher;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * Common reactive interface for collection object
 * 
 * @author Nikita Koksharov
 *
 * @param  value
 */
public interface RCollectionReactive extends RExpirableReactive {

    /**
     * Returns iterator over collection elements
     * 
     * @return iterator
     */
    Flux iterator();

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

    /**
     * Removes all of this collection's elements that are also contained in the
     * specified collection (optional operation).
     *
     * @param c collection containing elements to be removed from this collection
     * @return true if this collection changed as a result of the
     *         call
     */
    Mono removeAll(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
     */
    Mono contains(V 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
     */
    Mono containsAll(Collection c);

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

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

    /**
     * Adds element into this collection.
     * 
     * @param e - element to add
     * @return true if an element was added 
     *          and false if it is already present
     */
    Mono add(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
     */
    Mono addAll(Publisher c);
    
    /**
     * 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
     */
    Mono addAll(Collection c);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy