Interface RSetAsync<V>

Type Parameters:
V - value
All Superinterfaces:
RCollectionAsync<V>, RExpirableAsync, RObjectAsync, RSortableAsync<Set<V>>
All Known Subinterfaces:
RSet<V>
All Known Implementing Classes:
RedissonSet, RedissonSetMultimapValues, RedissonTransactionalSet

public interface RSetAsync<V> extends RCollectionAsync<V>, RSortableAsync<Set<V>>
Async set functions
Author:
Nikita Koksharov
  • Method Details

    • removeRandomAsync

      RFuture<Set<V>> removeRandomAsync(int amount)
      Removes and returns random elements from set in async mode
      Parameters:
      amount - of random values
      Returns:
      random values
    • removeRandomAsync

      RFuture<V> removeRandomAsync()
      Removes and returns random element from set in async mode
      Returns:
      value
    • randomAsync

      RFuture<V> randomAsync()
      Returns random element from set in async mode
      Returns:
      value
    • randomAsync

      RFuture<Set<V>> randomAsync(int count)
      Returns random elements from set limited by count
      Parameters:
      count - - values amount to return
      Returns:
      value
    • moveAsync

      RFuture<Boolean> moveAsync(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
    • readAllAsync

      RFuture<Set<V>> readAllAsync()
      Read all elements at once
      Returns:
      values
    • unionAsync

      RFuture<Integer> unionAsync(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
    • readUnionAsync

      RFuture<Set<V>> readUnionAsync(String... names)
      Union sets specified by name with current set. Without current set state change.
      Parameters:
      names - - name of sets
      Returns:
      values
    • diffAsync

      RFuture<Integer> diffAsync(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
    • readDiffAsync

      RFuture<Set<V>> readDiffAsync(String... names)
      Diff sets specified by name with current set. Without current set state change.
      Parameters:
      names - - name of sets
      Returns:
      values
    • intersectionAsync

      RFuture<Integer> intersectionAsync(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
    • readIntersectionAsync

      RFuture<Set<V>> readIntersectionAsync(String... names)
      Intersection sets specified by name with current set. Without current set state change.
      Parameters:
      names - - name of sets
      Returns:
      values
    • countIntersectionAsync

      RFuture<Integer> countIntersectionAsync(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
    • countIntersectionAsync

      RFuture<Integer> countIntersectionAsync(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
    • tryAddAsync

      RFuture<Boolean> tryAddAsync(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.
    • addAllCountedAsync

      RFuture<Integer> addAllCountedAsync(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
    • removeAllCountedAsync

      RFuture<Integer> removeAllCountedAsync(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