Diffusion .NET Client Library
6.1.5
|
The mutable data model of IRecordV2 data based upon a Schema.ISchema. More...
Public Member Functions | |
IMutableRecordModel | Set (string recordName, int recordIndex, string fieldName, int fieldIndex, string value) |
Sets a specified field value. More... | |
IMutableRecordModel | Set (string key, string value) |
Sets a specified field value. More... | |
IMutableRecordModel | Add (string recordName, int recordIndex, params string[] values) |
Adds new values to the end of a variable length field list. More... | |
IMutableRecordModel | Add (params string[] values) |
Adds new values to the end of a variable length field list. More... | |
IMutableRecordModel | AddRecord () |
Adds a new initialized record occurrence to the end of a variable multiplicity record list. More... | |
IMutableRecordModel | RemoveRecord (int index) |
Removes the specified occurrence of a variable multiplicity record. More... | |
IMutableRecordModel | RemoveField (string recordName, int recordIndex, int fieldIndex) |
Removes the specified occurrence of a variable multiplicity field. More... | |
IMutableRecordModel | ClearVariableRecords () |
Removes all optional instances of a variable multiplicity record. More... | |
IMutableRecordModel | ClearVariableFields (string recordName, int recordIndex) |
Remove all optional instances of a variable multiplicity field. More... | |
Public Member Functions inherited from PushTechnology.ClientInterface.Data.Record.Model.IRecordModel | |
string | Get (string recordName, int recordIndex, string fieldName, int fieldIndex) |
Returns a field value. More... | |
string | Get (string key) |
Returns a field value. More... | |
int | RecordCount (string recordName) |
Returns the actual number of occurrences of a named record. More... | |
int | FieldCount (string recordName, int recordIndex, string fieldName) |
Returns the actual number of occurrences of a named field within a specified record occurrences. More... | |
IRecordV2 | AsValue () |
Creates an immutable IRecordV2 object generated from the model. More... | |
The mutable data model of IRecordV2 data based upon a Schema.ISchema.
An initial version of such a model can be created from a schema using the Schema.ISchema.CreateMutableModel method. A model created in this way will have all mandatory fields set to default values.
The model may then be updated as required and then at any time a IRecordV2 object can be generated from the current state using the IRecordModel.AsValue method. The IRecordV2 object may then be used to update a topic.
When values for integer or decimal type fields are supplied the values are validated and normalized.
All mutator methods return the model so that calls can be chained.
Implemented in Version 6.0.
IMutableRecordModel PushTechnology.ClientInterface.Data.Record.Model.IMutableRecordModel.Add | ( | string | recordName, |
int | recordIndex, | ||
params string[] | values | ||
) |
Adds new values to the end of a variable length field list.
This can only be used for a variable multiplicity field which can only be the last field in a record and therefore the field does not need to be named.
recordName | The name of the record. |
recordIndex | The index identifying the occurrence of the record. |
values | The values to add. |
IMutableRecordModel PushTechnology.ClientInterface.Data.Record.Model.IMutableRecordModel.Add | ( | params string[] | values | ) |
Adds new values to the end of a variable length field list.
This is a convenience method for adding to the end of the last record and is therefore useful when there is only one record type.
values | The values. |
IMutableRecordModel PushTechnology.ClientInterface.Data.Record.Model.IMutableRecordModel.AddRecord | ( | ) |
Adds a new initialized record occurrence to the end of a variable multiplicity record list.
As the only variable multiplicity record can be the last one there is no need to name the record. This method will add to the list of occurrences of the last defined record. The record will be initialized with default values appropriate to the schema definition and may then have individual field items set separately.
IMutableRecordModel PushTechnology.ClientInterface.Data.Record.Model.IMutableRecordModel.ClearVariableFields | ( | string | recordName, |
int | recordIndex | ||
) |
Remove all optional instances of a variable multiplicity field.
As a variable repeating field can only be the last or only field within a record then the field name does not need to be specified.
This will only remove field occurrences down to the minimum number of occurrences specified by the schema.
If the last or only field within the record is not defined as variable multiplicity, this would have no effect.
recordName | The name of the record. |
recordIndex | The index of the record. |
IMutableRecordModel PushTechnology.ClientInterface.Data.Record.Model.IMutableRecordModel.ClearVariableRecords | ( | ) |
Removes all optional instances of a variable multiplicity record.
As a variable repeating record can only be the last or only record then the record name does not need to be specified.
This will only remove record occurrences down to the minimum number of occurrences specified by the schema.
If the last or only record is not defined as variable multiplicity, this would have no effect.
IMutableRecordModel PushTechnology.ClientInterface.Data.Record.Model.IMutableRecordModel.RemoveField | ( | string | recordName, |
int | recordIndex, | ||
int | fieldIndex | ||
) |
Removes the specified occurrence of a variable multiplicity field.
A variable multiplicity field must be the last or only field within a record and therefore the field name is not required.
recordName | The name of the record. |
recordIndex | The record index. |
fieldIndex | The index of the field to remove. |
IMutableRecordModel PushTechnology.ClientInterface.Data.Record.Model.IMutableRecordModel.RemoveRecord | ( | int | index | ) |
Removes the specified occurrence of a variable multiplicity record.
A variable multiplicity record must be the last or only record within a schema and therefore the record name is not required.
index | The index of the record to remove. |
IMutableRecordModel PushTechnology.ClientInterface.Data.Record.Model.IMutableRecordModel.Set | ( | string | recordName, |
int | recordIndex, | ||
string | fieldName, | ||
int | fieldIndex, | ||
string | value | ||
) |
Sets a specified field value.
recordName | The name of the record containing the field. |
recordIndex | The index of the record containing the field. |
fieldName | The name of the field. |
fieldIndex | The index of the field. |
value | The new value. |
IMutableRecordModel PushTechnology.ClientInterface.Data.Record.Model.IMutableRecordModel.Set | ( | string | key, |
string | value | ||
) |
Sets a specified field value.
This allows an item to be addressed using a key of the form "RecordName(RecordIndex).FieldName(FieldIndex)"
. Indices may be omitted in which case 0 is assumed. The record part may also be omitted in which case the first occurrence of the first record is assumed.
key | The field key. |
value | The field value. |