Interface BoundSetOperations<K,V>

All Superinterfaces:
BoundKeyOperations<K>

public interface BoundSetOperations<K,V> extends BoundKeyOperations<K>
Set operations bound to a certain key.
Author:
Costin Leau, Mark Paluch
  • Method Details

    • add

      @Nullable Long add(V... values)
      Add given values to set at the bound key.
      Parameters:
      values -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • remove

      @Nullable Long remove(Object... values)
      Remove given values from set at the bound key and return the number of removed elements.
      Parameters:
      values -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • pop

      @Nullable V pop()
      Remove and return a random member from set at the bound key.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • move

      @Nullable Boolean move(K destKey, V value)
      Move value from the bound key to destKey
      Parameters:
      destKey - must not be null.
      value -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • size

      @Nullable Long size()
      Get size of set at the bound key.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • isMember

      @Nullable Boolean isMember(Object o)
      Check if set at the bound key contains value.
      Parameters:
      o -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • isMember

      @Nullable Map<Object,Boolean> isMember(Object... objects)
      Check if set at at the bound key contains one or more values.
      Parameters:
      objects -
      Returns:
      null when used in pipeline / transaction.
      Since:
      2.6
      See Also:
    • intersect

      @Nullable Set<V> intersect(K key)
      Returns the members intersecting all given sets at the bound key and key.
      Parameters:
      key - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • intersect

      @Nullable Set<V> intersect(Collection<K> keys)
      Returns the members intersecting all given sets at the bound key and keys.
      Parameters:
      keys - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • intersectAndStore

      void intersectAndStore(K key, K destKey)
      Intersect all given sets at the bound key and key and store result in destKey.
      Parameters:
      key - must not be null.
      destKey - must not be null.
      See Also:
    • intersectAndStore

      void intersectAndStore(Collection<K> keys, K destKey)
      Intersect all given sets at the bound key and keys and store result in destKey.
      Parameters:
      keys - must not be null.
      destKey - must not be null.
      See Also:
    • union

      @Nullable Set<V> union(K key)
      Union all sets at given key and key.
      Parameters:
      key - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • union

      @Nullable Set<V> union(Collection<K> keys)
      Union all sets at given keys and keys.
      Parameters:
      keys - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • unionAndStore

      void unionAndStore(K key, K destKey)
      Union all sets at given the bound key and key and store result in destKey.
      Parameters:
      key - must not be null.
      destKey - must not be null.
      See Also:
    • unionAndStore

      void unionAndStore(Collection<K> keys, K destKey)
      Union all sets at given the bound key and keys and store result in destKey.
      Parameters:
      keys - must not be null.
      destKey - must not be null.
      See Also:
    • diff

      @Nullable default Set<V> diff(K key)
      Deprecated.
      since 3.0, use difference(Object) instead to follow a consistent method naming scheme.
      Diff all sets for given the bound key and key.
      Parameters:
      key - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • difference

      @Nullable Set<V> difference(K key)
      Diff all sets for given the bound key and key.
      Parameters:
      key - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • diff

      @Nullable default Set<V> diff(Collection<K> keys)
      Deprecated.
      since 3.0, use difference(Collection) instead to follow a consistent method naming scheme.
      Diff all sets for given the bound key and keys.
      Parameters:
      keys - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • difference

      @Nullable Set<V> difference(Collection<K> keys)
      Diff all sets for given the bound key and keys.
      Parameters:
      keys - must not be null.
      Returns:
      null when used in pipeline / transaction.
      Since:
      3.0
      See Also:
    • diffAndStore

      @Deprecated default void diffAndStore(K keys, K destKey)
      Deprecated.
      since 3.0, use differenceAndStore(Object, Object) instead to follow a consistent method naming scheme..
      Diff all sets for given the bound key and keys and store result in destKey.
      Parameters:
      keys - must not be null.
      destKey - must not be null.
      See Also:
    • differenceAndStore

      void differenceAndStore(K keys, K destKey)
      Diff all sets for given the bound key and keys and store result in destKey.
      Parameters:
      keys - must not be null.
      destKey - must not be null.
      Since:
      3.0
      See Also:
    • diffAndStore

      @Deprecated default void diffAndStore(Collection<K> keys, K destKey)
      Deprecated.
      since 3.0, use differenceAndStore(Collection, Object) instead to follow a consistent method naming scheme.
      Diff all sets for given the bound key and keys and store result in destKey.
      Parameters:
      keys - must not be null.
      destKey - must not be null.
      See Also:
    • differenceAndStore

      void differenceAndStore(Collection<K> keys, K destKey)
      Diff all sets for given the bound key and keys and store result in destKey.
      Parameters:
      keys - must not be null.
      destKey - must not be null.
      Since:
      3.0
      See Also:
    • members

      @Nullable Set<V> members()
      Get all elements of set at the bound key.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • randomMember

      @Nullable V randomMember()
      Get random element from set at the bound key.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • distinctRandomMembers

      @Nullable Set<V> distinctRandomMembers(long count)
      Get count distinct random elements from set at the bound key.
      Parameters:
      count -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • randomMembers

      @Nullable List<V> randomMembers(long count)
      Get count random elements from set at the bound key.
      Parameters:
      count -
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • scan

      @Nullable Cursor<V> scan(ScanOptions options)
      Use a Cursor to iterate over entries in set at key.
      Important: Call CloseableIterator.close() when done to avoid resource leaks.
      Parameters:
      options - must not be null.
      Returns:
      the result cursor providing access to the scan result. Must be closed once fully processed (e.g. through a try-with-resources clause).
      Since:
      1.4
    • getOperations

      RedisOperations<K,V> getOperations()
      Returns:
      never null.