isValueChanged method
- String fieldName
Inquiry method that asks whether the value for a field has changed after the reception of the last update from the Server for an item.
If the Subscription mode is COMMAND then the change is meant as relative to the same key.
fieldName
The field name as specified within the "Field List".
Throws IllegalArgumentException if the specified field is not part of the Subscription.
Returns Unless the Subscription mode is COMMAND, the return value is true in the following cases:
- It is the first update for the item;
- the new field value is different than the previous field value received for the item.
- it is the first update for the involved key value (i.e. the event carries an "ADD" command);
- the new field value is different than the previous field value received for the item, relative to the same key value (the event must carry an "UPDATE" command);
- the event carries a "DELETE" command (this applies to all fields other than the field used to carry key information).
Implementation
bool isValueChanged(String fieldName) {
return _changedFields.containsKey(fieldName);
}