public class AtomicReferenceProxy<E> extends AbstractDistributedObject<AtomicReferenceService> implements AsyncAtomicReference<E>
PARTITIONING_STRATEGY| Constructor and Description | 
|---|
AtomicReferenceProxy(String name,
                    NodeEngine nodeEngine,
                    AtomicReferenceService service)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
alter(IFunction<E,E> function)
Alters the currently stored reference by applying a function on it. 
 | 
E | 
alterAndGet(IFunction<E,E> function)
Alters the currently stored reference by applying a function on it and gets the result. 
 | 
<R> R | 
apply(IFunction<E,R> function)
Applies a function on the value, the actual stored value will not change. 
 | 
InternalCompletableFuture<Void> | 
asyncAlter(IFunction<E,E> function)  | 
InternalCompletableFuture<E> | 
asyncAlterAndGet(IFunction<E,E> function)  | 
<R> InternalCompletableFuture<R> | 
asyncApply(IFunction<E,R> function)  | 
InternalCompletableFuture<Void> | 
asyncClear()  | 
InternalCompletableFuture<Boolean> | 
asyncCompareAndSet(E expect,
                  E update)  | 
InternalCompletableFuture<Boolean> | 
asyncContains(E value)  | 
InternalCompletableFuture<E> | 
asyncGet()  | 
InternalCompletableFuture<E> | 
asyncGetAndAlter(IFunction<E,E> function)  | 
InternalCompletableFuture<E> | 
asyncGetAndSet(E newValue)  | 
InternalCompletableFuture<Boolean> | 
asyncIsNull()  | 
InternalCompletableFuture<Void> | 
asyncSet(E newValue)  | 
InternalCompletableFuture<E> | 
asyncSetAndGet(E update)  | 
void | 
clear()
Clears the current stored reference. 
 | 
boolean | 
compareAndSet(E expect,
             E update)
Atomically sets the value to the given updated value
 only if the current value  
== the expected value. | 
boolean | 
contains(E expected)
Checks if the reference contains the value. 
 | 
E | 
get()
Gets the current value. 
 | 
E | 
getAndAlter(IFunction<E,E> function)
Alters the currently stored reference by applying a function on it on and gets the old value. 
 | 
E | 
getAndSet(E newValue)
Gets the value and sets the new value. 
 | 
String | 
getName()
Returns the unique name for this DistributedObject. 
 | 
int | 
getPartitionId()  | 
String | 
getServiceName()
Returns the service name for this object. 
 | 
boolean | 
isNull()
Checks if the stored reference is null. 
 | 
void | 
set(E newValue)
Atomically sets the given value. 
 | 
E | 
setAndGet(E update)
Sets and gets the value. 
 | 
String | 
toString()  | 
destroy, equals, getId, getNameAsPartitionAwareData, getNodeEngine, getPartitionKey, getService, hashCode, invalidate, postDestroy, throwNotActiveExceptionclone, finalize, getClass, notify, notifyAll, wait, wait, waitdestroy, getId, getPartitionKeypublic AtomicReferenceProxy(String name, NodeEngine nodeEngine, AtomicReferenceService service)
public void alter(IFunction<E,E> function)
IAtomicReferencealter in interface IAtomicReference<E>function - the functionpublic InternalCompletableFuture<Void> asyncAlter(IFunction<E,E> function)
asyncAlter in interface AsyncAtomicReference<E>public E alterAndGet(IFunction<E,E> function)
IAtomicReferencealterAndGet in interface IAtomicReference<E>function - the functionpublic InternalCompletableFuture<E> asyncAlterAndGet(IFunction<E,E> function)
asyncAlterAndGet in interface AsyncAtomicReference<E>public E getAndAlter(IFunction<E,E> function)
IAtomicReferencegetAndAlter in interface IAtomicReference<E>function - the functionpublic InternalCompletableFuture<E> asyncGetAndAlter(IFunction<E,E> function)
asyncGetAndAlter in interface AsyncAtomicReference<E>public <R> R apply(IFunction<E,R> function)
IAtomicReferenceapply in interface IAtomicReference<E>function - the functionpublic <R> InternalCompletableFuture<R> asyncApply(IFunction<E,R> function)
asyncApply in interface AsyncAtomicReference<E>public void clear()
IAtomicReferenceclear in interface IAtomicReference<E>public InternalCompletableFuture<Void> asyncClear()
asyncClear in interface AsyncAtomicReference<E>public boolean compareAndSet(E expect, E update)
IAtomicReference== the expected value.compareAndSet in interface IAtomicReference<E>expect - the expected valueupdate - the new valuepublic InternalCompletableFuture<Boolean> asyncCompareAndSet(E expect, E update)
asyncCompareAndSet in interface AsyncAtomicReference<E>public E get()
IAtomicReferenceget in interface IAtomicReference<E>public InternalCompletableFuture<E> asyncGet()
asyncGet in interface AsyncAtomicReference<E>public boolean contains(E expected)
IAtomicReferencecontains in interface IAtomicReference<E>expected - the value to check (is allowed to be null).public InternalCompletableFuture<Boolean> asyncContains(E value)
asyncContains in interface AsyncAtomicReference<E>public void set(E newValue)
IAtomicReferenceset in interface IAtomicReference<E>newValue - the new valuepublic InternalCompletableFuture<Void> asyncSet(E newValue)
asyncSet in interface AsyncAtomicReference<E>public E getAndSet(E newValue)
IAtomicReferencegetAndSet in interface IAtomicReference<E>newValue - the new value.public InternalCompletableFuture<E> asyncGetAndSet(E newValue)
asyncGetAndSet in interface AsyncAtomicReference<E>public E setAndGet(E update)
IAtomicReferencesetAndGet in interface IAtomicReference<E>update - the new valuepublic InternalCompletableFuture<E> asyncSetAndGet(E update)
asyncSetAndGet in interface AsyncAtomicReference<E>public boolean isNull()
IAtomicReferenceisNull in interface IAtomicReference<E>public InternalCompletableFuture<Boolean> asyncIsNull()
asyncIsNull in interface AsyncAtomicReference<E>public String getName()
DistributedObjectgetName in interface DistributedObjectpublic int getPartitionId()
public String getServiceName()
DistributedObjectgetServiceName in interface DistributedObjectgetServiceName in class AbstractDistributedObject<AtomicReferenceService>public String toString()
toString in class AbstractDistributedObject<AtomicReferenceService>Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.