T
- the type of the value it holds.public interface Attribute<T>
Modifier and Type | Method and Description |
---|---|
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 |
getAndRemove()
Removes this attribute from the
AttributeMap and returns the old value.. |
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 |
remove()
Removes this attribute from the
AttributeMap . |
void |
set(T value)
Sets the value
|
T |
setIfAbsent(T value)
Atomically sets to the given value if this
Attribute does not contain a value at the moment. |
AttributeKey<T> key()
T get()
null
void set(T value)
T getAndSet(T value)
null
if non was set before.T setIfAbsent(T value)
Attribute
does not contain a value at the moment.
If it was not possible to set the value as it contains a value it will just return the current value.T getAndRemove()
AttributeMap
and returns the old value.. Subsequent get()
calls will return @{code null}.boolean compareAndSet(T oldValue, T newValue)
true
otherwise false
.void remove()
AttributeMap
. Subsequent get()
calls will return @{code null}.Copyright © 2008–2015 The Netty Project. All rights reserved.