Replaces a user defined attribute with the specified key if the
value of the attribute is equals to the specified old value.
This method is same with the following code except that the operation
is performed atomically.
<pre>
if (containsAttribute(key) && getAttribute(key).equals(oldValue)) {
setAttribute(key, newValue);
return true;
} else {
return false;
}
</pre>
@param key The key we want to replace
@param oldValue The previous value
@param newValue The new value
@return <tt>true</tt> if the replacement was successful
Replaces a user defined attribute with the specified key if the value of the attribute is equals to the specified old value. This method is same with the following code except that the operation is performed atomically. <pre> if (containsAttribute(key) && getAttribute(key).equals(oldValue)) { setAttribute(key, newValue); return true; } else { return false; } </pre>
@param key The key we want to replace @param oldValue The previous value @param newValue The new value @return <tt>true</tt> if the replacement was successful