Interface RSetRx<V>

Type Parameters:
V - type of value
All Superinterfaces:
RCollectionRx<V>, RExpirableRx, RObjectRx, RSortableRx<Set<V>>

public interface RSetRx<V> extends RCollectionRx<V>, RSortableRx<Set<V>>
RxJava2 interface for Redis based implementation of Set
Author:
Nikita Koksharov
  • Method Details

    • addAllCounted

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<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

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

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

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

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

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

      io.reactivex.rxjava3.core.Flowable<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

      io.reactivex.rxjava3.core.Flowable<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

      io.reactivex.rxjava3.core.Flowable<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

      io.reactivex.rxjava3.core.Single<Set<V>> removeRandom(int amount)
      Removes and returns random elements limited by amount
      Parameters:
      amount - of random elements
      Returns:
      random elements
    • removeRandom

      io.reactivex.rxjava3.core.Maybe<V> removeRandom()
      Removes and returns random element
      Returns:
      random element
    • random

      io.reactivex.rxjava3.core.Maybe<V> random()
      Returns random element
      Returns:
      random element
    • random

      io.reactivex.rxjava3.core.Single<Set<V>> random(int count)
      Returns random elements from set limited by count
      Parameters:
      count - - values amount to return
      Returns:
      random elements
    • move

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<Set<V>> readAll()
      Read all elements at once
      Returns:
      values
    • union

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<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:
      limit - - sets intersection limit
      names - - name of sets
      Returns:
      amount of elements
    • readIntersection

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<List<V>> containsEach(Collection<V> c)
      Check if each element is contained in the specified collection. Returns contained elements.

      Requires Redis 6.2.0 and higher.

      Parameters:
      c - - collection to check
      Returns:
      contained elements
    • addListener

      io.reactivex.rxjava3.core.Single<Integer> addListener(ObjectListener listener)
      Adds object event listener
      Specified by:
      addListener in interface RObjectRx
      Parameters:
      listener - - object event listener
      Returns:
      listener id
      See Also: