Interface RSetReactive<V>

Type Parameters:
V - type of value
All Superinterfaces:
RCollectionReactive<V>, RExpirableReactive, RObjectReactive, RSortableReactive<Set<V>>

public interface RSetReactive<V> extends RCollectionReactive<V>, RSortableReactive<Set<V>>
Reactive interface for Redis based implementation of Set
Author:
Nikita Koksharov
  • Method Details

    • addAllCounted

      reactor.core.publisher.Mono<Integer> addAllCounted(Collection<? extends V> c)
      Adds all elements contained in the specified collection. Returns number of added elements.
      Parameters:
      c - - collection of elements to add
      Returns:
      number of added elements
    • removeAllCounted

      reactor.core.publisher.Mono<Integer> removeAllCounted(Collection<? extends V> c)
      Removes all elements contained in the specified collection. Returns number of removed elements.
      Parameters:
      c - - collection of elements to add
      Returns:
      number of removed elements
    • getPermitExpirableSemaphore

      RPermitExpirableSemaphoreReactive getPermitExpirableSemaphore(V value)
      Returns RPermitExpirableSemaphore instance associated with value
      Parameters:
      value - - set value
      Returns:
      RPermitExpirableSemaphore object
    • getSemaphore

      RSemaphoreReactive getSemaphore(V value)
      Returns RSemaphore instance associated with value
      Parameters:
      value - - set value
      Returns:
      RSemaphore object
    • getFairLock

      RLockReactive getFairLock(V value)
      Returns RLock instance associated with value
      Parameters:
      value - - set value
      Returns:
      RLock object
    • getReadWriteLock

      RReadWriteLockReactive getReadWriteLock(V value)
      Returns RReadWriteLock instance associated with value
      Parameters:
      value - - set value
      Returns:
      RReadWriteLock object
    • getLock

      RLockReactive getLock(V value)
      Returns lock instance associated with value
      Parameters:
      value - - set value
      Returns:
      RLock object
    • iterator

      reactor.core.publisher.Flux<V> iterator(int count)
      Returns elements iterator fetches elements in a batch. Batch size is defined by count param.
      Parameters:
      count - - size of elements batch
      Returns:
      iterator
    • iterator

      reactor.core.publisher.Flux<V> iterator(String pattern, int count)
      Returns elements iterator fetches elements in a batch. Batch size is defined by count param. If pattern is not null then only elements match this pattern are loaded.
      Parameters:
      pattern - - search pattern
      count - - size of elements batch
      Returns:
      iterator
    • iterator

      reactor.core.publisher.Flux<V> iterator(String pattern)
      Returns elements iterator. If pattern is not null then only elements match this pattern are loaded.
      Parameters:
      pattern - - search pattern
      Returns:
      iterator
    • removeRandom

      reactor.core.publisher.Mono<Set<V>> removeRandom(int amount)
      Removes and returns random elements limited by amount
      Parameters:
      amount - of random elements
      Returns:
      random elements
    • removeRandom

      reactor.core.publisher.Mono<V> removeRandom()
      Removes and returns random element
      Returns:
      random element
    • random

      reactor.core.publisher.Mono<V> random()
      Returns random element
      Returns:
      random element
    • random

      reactor.core.publisher.Mono<Set<V>> random(int count)
      Returns random elements from set limited by count
      Parameters:
      count - - values amount to return
      Returns:
      random elements
    • move

      reactor.core.publisher.Mono<Boolean> move(String destination, V member)
      Move a member from this set to the given destination set in async mode.
      Parameters:
      destination - the destination set
      member - the member to move
      Returns:
      true if the element is moved, false if the element is not a member of this set or no operation was performed
    • readAll

      reactor.core.publisher.Mono<Set<V>> readAll()
      Read all elements at once
      Returns:
      values
    • union

      reactor.core.publisher.Mono<Integer> union(String... names)
      Union sets specified by name and write to current set. If current set already exists, it is overwritten.
      Parameters:
      names - - name of sets
      Returns:
      size of union
    • readUnion

      reactor.core.publisher.Mono<Set<V>> readUnion(String... names)
      Union sets specified by name with current set. Without current set state change.
      Parameters:
      names - - name of sets
      Returns:
      size of union
    • diff

      reactor.core.publisher.Mono<Integer> diff(String... names)
      Diff sets specified by name and write to current set. If current set already exists, it is overwritten.
      Parameters:
      names - - name of sets
      Returns:
      size of diff
    • readDiff

      reactor.core.publisher.Mono<Set<V>> readDiff(String... names)
      Diff sets specified by name with current set. Without current set state change.
      Parameters:
      names - - name of sets
      Returns:
      values
    • intersection

      reactor.core.publisher.Mono<Integer> intersection(String... names)
      Intersection sets specified by name and write to current set. If current set already exists, it is overwritten.
      Parameters:
      names - - name of sets
      Returns:
      size of intersection
    • countIntersection

      reactor.core.publisher.Mono<Integer> countIntersection(String... names)
      Counts elements of set as a result of sets intersection with current set.

      Requires Redis 7.0.0 and higher.

      Parameters:
      names - - name of sets
      Returns:
      amount of elements
    • countIntersection

      reactor.core.publisher.Mono<Integer> countIntersection(int limit, String... names)
      Counts elements of set as a result of sets intersection with current set.

      Requires Redis 7.0.0 and higher.

      Parameters:
      names - - name of sets
      limit - - sets intersection limit
      Returns:
      amount of elements
    • readIntersection

      reactor.core.publisher.Mono<Set<V>> readIntersection(String... names)
      Intersection sets specified by name with current set. Without current set state change.
      Parameters:
      names - - name of sets
      Returns:
      values
    • tryAdd

      reactor.core.publisher.Mono<Boolean> tryAdd(V... values)
      Tries to add elements only if none of them in set.
      Parameters:
      values - - values to add
      Returns:
      true if elements successfully added, otherwise false.
    • containsEach

      reactor.core.publisher.Mono<List<V>> containsEach(Collection<V> c)
      Check if each element is contained in the specified collection. Returns contained elements.
      Parameters:
      c - - collection to check
      Returns:
      contained elements