E
- set entry typepublic interface AsyncDistributedSet<E> extends DistributedPrimitive
DistributedPrimitive.Status, DistributedPrimitive.Type
DEFAULT_OPERATION_TIMEOUT_MILLIS
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Boolean> |
add(E element)
Adds the specified element to this set if it is not already present (optional operation).
|
CompletableFuture<Boolean> |
addAll(Collection<? extends E> c)
Adds all of the elements in the specified collection to this set if they're not
already present (optional operation).
|
CompletableFuture<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. |
CompletableFuture<Void> |
clear()
Removes all elements from the set.
|
CompletableFuture<Boolean> |
contains(E element)
Returns if this set contains the specified element.
|
CompletableFuture<Boolean> |
containsAll(Collection<? extends E> c)
Returns if this set contains all the elements in specified collection.
|
CompletableFuture<? extends Set<E>> |
getAsImmutableSet()
Returns the entries as a immutable set.
|
CompletableFuture<Boolean> |
isEmpty()
Returns if the set is empty.
|
default DistributedPrimitive.Type |
primitiveType()
Returns the type of primitive.
|
CompletableFuture<Boolean> |
remove(E element)
Removes the specified element to this set if it is present (optional operation).
|
CompletableFuture<Boolean> |
removeAll(Collection<? extends E> c)
Removes from this set all of its elements that are contained in the specified collection (optional operation).
|
CompletableFuture<Void> |
removeListener(SetEventListener<E> listener)
Unregisters the specified listener.
|
CompletableFuture<Boolean> |
retainAll(Collection<? extends E> c)
Retains only the elements in this set that are contained in the specified collection (optional operation).
|
CompletableFuture<Integer> |
size()
Returns the number of elements in the set.
|
addStatusChangeListener, applicationId, destroy, name, removeStatusChangeListener, statusChangeListeners
default DistributedPrimitive.Type primitiveType()
DistributedPrimitive
primitiveType
in interface DistributedPrimitive
CompletableFuture<Void> addListener(SetEventListener<E> listener)
listener
- listener to notify about set update eventsCompletableFuture<Void> removeListener(SetEventListener<E> listener)
listener
- listener to unregister.CompletableFuture<Boolean> add(E element)
element
- element to addtrue
if this set did not already contain the specified element.CompletableFuture<Boolean> remove(E element)
element
- element to removetrue
if this set contained the specified elementCompletableFuture<Integer> size()
CompletableFuture<Boolean> isEmpty()
true
if this set is emptyCompletableFuture<Void> clear()
CompletableFuture<Boolean> contains(E element)
element
- element to checktrue
if this set contains the specified elementCompletableFuture<Boolean> addAll(Collection<? extends E> c)
c
- collection containing elements to be added to this settrue
if this set contains all elements in the collectionCompletableFuture<Boolean> containsAll(Collection<? extends E> c)
c
- collectiontrue
if this set contains all elements in the collectionCompletableFuture<Boolean> retainAll(Collection<? extends E> c)
c
- collection containing elements to be retained in this settrue
if this set changed as a result of the callCompletableFuture<Boolean> removeAll(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
instanceCompletableFuture<? extends Set<E>> getAsImmutableSet()