Diffusion .NET Client Library  6.1.5
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
PushTechnology.ClientInterface.Data.Record.IRecordV2Delta Interface Reference

The IRecordV2 structural delta. More...

Public Member Functions

IReadOnlyList< IChangeChanges (ISchema schema)
 Returns a list of the changes represented by the delta with reference to a specified schema. More...
 

Detailed Description

The IRecordV2 structural delta.

A IRecordV2Delta describes the differences between two IRecordV2 values. Unlike a IBinaryDelta, a structural delta can be queried to determine its effect. The Changes(ISchema) method provides details of which values have changed.

An instance can be created from two IRecordV2 values using IRecordV2.Diff(IRecordV2).

Implemented in Version 6.0.

RecordV2Deltas are useful for identifying small changes to complex RecordV2 values. Here's an example of how to use this class to filter interesting changes in a ValueStream.

public class ExampleStream : IValueStream&lt;IRecordV2&gt; {
public void OnValue( string topicPath, ITopicSpecification specification, IRecordV2 oldValue, IRecordV2 newValue ) {
var delta = newValue.Diff( oldValue );
foreach ( var change in delta.Changes( schema ) ) {
if ( change.FieldName == "address" ) {
ProcessAddress( newValue );
}
}
// ...
}
// ...
}

Member Function Documentation

IReadOnlyList<IChange> PushTechnology.ClientInterface.Data.Record.IRecordV2Delta.Changes ( ISchema  schema)

Returns a list of the changes represented by the delta with reference to a specified schema.

The schema supplied must comply with the data format of the delta. No validation takes place, so if the schema does not match the data then the results may be unpredictable.

Parameters
schemaThe schema.
Returns
The immutable list of changes.

The documentation for this interface was generated from the following file: