Constructor and Description |
---|
SharedData(T obj)
Initializes the class with the protected object.
|
Modifier and Type | Method and Description |
---|---|
T |
compareExchange(T newValue,
T comparand)
Compares and replaces the encapsulated (old) value with the newValue if it is equal to the comparand.
|
T |
compareExchangeNotEqual(T newValue,
T comparand)
Compares and replaces the encapsulated (old) value with the newValue if it is not equal to the comparand.
|
T |
compareExchangePredicate(T newValue,
lombok.Predicates.Predicate1<T> predicate)
Compares and replaces the encapsulated (old) value with the newValueif the given predicate returns true.
|
T |
get()
Gets the value of the protected object
|
void |
lock()
Locks the object
|
void |
set(T newValue)
Sets the value of the protected object
|
void |
unlock()
Unlocks the object
|
public SharedData(T obj)
public void unlock()
public T get()
public void set(T newValue)
public T compareExchange(T newValue, T comparand)
public T compareExchangeNotEqual(T newValue, T comparand)
public T compareExchangePredicate(T newValue, lombok.Predicates.Predicate1<T> predicate)