T - the type of the value it holds.public interface Attribute<T>
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
compareAndSet(T oldValue,
T newValue)
Atomically sets the value to the given updated value if the current value == the expected value.
|
T |
get()
Returns the current value, which may be
null |
T |
getAndSet(T value)
Atomically sets to the given value and returns the old value
which may be
null if non was set before. |
AttributeKey<T> |
key()
Returns the key of this attribute.
|
void |
set(T value)
Sets the value
|
T |
setIfAbsent(T value)
Atomically sets to the given value if this
Attribute's value is null. |
AttributeKey<T> key()
T get()
nullvoid set(T value)
T getAndSet(T value)
null if non was set before.T setIfAbsent(T value)
Attribute's value is null.
If it was not possible to set the value as it contains a value
it will just return the current value.Copyright © 2021. All rights reserved.