isValueChangedByPosition method
- int fieldPosition
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.
fieldPosition
The 1-based position of the field within the "Field List" or "Field Schema".
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 isValueChangedByPosition(int fieldPosition) {
return _changedFieldsByPosition.containsKey(fieldPosition);
}