E - set entry typepublic interface AsyncDistributedSet<E> extends DistributedPrimitive
All methods of AsyncDistributedSet immediately return a future.
The returned future will be completed when the operation
completes.
DistributedPrimitive.Status, DistributedPrimitive.TypeDEFAULT_OPERATION_TIMEOUT_MILLIS, DEFAULT_OPERTATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
add(E element)
Adds the specified element to this set if it is not already present (optional operation).
|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
addAll(java.util.Collection<? extends E> c)
Adds all of the elements in the specified collection to this set if they're not
already present (optional operation).
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
addListener(SetEventListener<E> listener)
Registers the specified listener to be notified whenever
the set is updated.
|
default DistributedSet<E> |
asDistributedSet()
Returns a new
DistributedSet that is backed by this instance. |
default DistributedSet<E> |
asDistributedSet(long timeoutMillis)
Returns a new
DistributedSet that is backed by this instance. |
java.util.concurrent.CompletableFuture<java.lang.Void> |
clear()
Removes all elements from the set.
|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
contains(E element)
Returns if this set contains the specified element.
|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
containsAll(java.util.Collection<? extends E> c)
Returns if this set contains all the elements in specified collection.
|
java.util.concurrent.CompletableFuture<? extends java.util.Set<E>> |
getAsImmutableSet()
Returns the entries as a immutable set.
|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
isEmpty()
Returns if the set is empty.
|
default DistributedPrimitive.Type |
primitiveType()
Returns the type of primitive.
|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
remove(E element)
Removes the specified element to this set if it is present (optional operation).
|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
removeAll(java.util.Collection<? extends E> c)
Removes from this set all of its elements that are contained in the specified collection (optional operation).
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
removeListener(SetEventListener<E> listener)
Unregisters the specified listener.
|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
retainAll(java.util.Collection<? extends E> c)
Retains only the elements in this set that are contained in the specified collection (optional operation).
|
java.util.concurrent.CompletableFuture<java.lang.Integer> |
size()
Returns the number of elements in the set.
|
addStatusChangeListener, applicationId, destroy, name, removeStatusChangeListener, statusChangeListenersdefault DistributedPrimitive.Type primitiveType()
DistributedPrimitiveprimitiveType in interface DistributedPrimitivejava.util.concurrent.CompletableFuture<java.lang.Void> addListener(SetEventListener<E> listener)
listener - listener to notify about set update eventsjava.util.concurrent.CompletableFuture<java.lang.Void> removeListener(SetEventListener<E> listener)
listener - listener to unregister.java.util.concurrent.CompletableFuture<java.lang.Boolean> add(E element)
element - element to addtrue if this set did not already contain the specified element.java.util.concurrent.CompletableFuture<java.lang.Boolean> remove(E element)
element - element to removetrue if this set contained the specified elementjava.util.concurrent.CompletableFuture<java.lang.Integer> size()
java.util.concurrent.CompletableFuture<java.lang.Boolean> isEmpty()
true if this set is emptyjava.util.concurrent.CompletableFuture<java.lang.Void> clear()
java.util.concurrent.CompletableFuture<java.lang.Boolean> contains(E element)
element - element to checktrue if this set contains the specified elementjava.util.concurrent.CompletableFuture<java.lang.Boolean> addAll(java.util.Collection<? extends E> c)
c - collection containing elements to be added to this settrue if this set contains all elements in the collectionjava.util.concurrent.CompletableFuture<java.lang.Boolean> containsAll(java.util.Collection<? extends E> c)
c - collectiontrue if this set contains all elements in the collectionjava.util.concurrent.CompletableFuture<java.lang.Boolean> retainAll(java.util.Collection<? extends E> c)
c - collection containing elements to be retained in this settrue if this set changed as a result of the calljava.util.concurrent.CompletableFuture<java.lang.Boolean> removeAll(java.util.Collection<? extends E> c)
c - collection containing elements to be removed from this settrue if this set changed as a result of the calldefault DistributedSet<E> asDistributedSet()
DistributedSet that is backed by this instance.DistributedSet instancedefault DistributedSet<E> asDistributedSet(long timeoutMillis)
DistributedSet that is backed by this instance.timeoutMillis - timeout duration for the returned DistributedSet operationsDistributedSet instancejava.util.concurrent.CompletableFuture<? extends java.util.Set<E>> getAsImmutableSet()