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'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.T getAndRemove()
AttributeMap and returns the old value. Subsequent get()
calls will return null.
If you only want to return the old value and clear the Attribute while still keep it in
AttributeMap use getAndSet(Object) with a value of null.boolean compareAndSet(T oldValue, T newValue)
true otherwise false.void remove()
AttributeMap. Subsequent get() calls will return @{code null}.
If you only want to remove the value and clear the Attribute while still keep it in
AttributeMap use set(Object) with a value of null.Copyright © 2008–2016 The Netty Project. All rights reserved.