![]() |
Diffusion .NET Classic API - Core and Common
5.9.4
|
A message record. More...
Public Member Functions | |
Record (IMRecord metadata, params string[] fields) | |
Record (params string[] fields) | |
Create a free-format record with zero or more fields. More... | |
void | AddFields (params string[] fields) |
Adds one or more fields to the end of the record. More... | |
void | AddFields< T > (ICollection< T > fields) |
Adds one or more fields to the end of the record. More... | |
void | AddField (int index, string field) |
Inserts a field at a specified index within the record, moving subsequent fields along the record. More... | |
string | RemoveField (int index) |
void | SetField (int index, string field) |
Replaces a field at a specified index within the record. More... | |
void | SetField (string name, params object[] values) |
Set field value(s) by name. More... | |
void | SetField (string name, int index, object value) |
Sets a field value by name and index. More... | |
void | SetFieldValues< T > (string name, ICollection< T > values) |
As SetField( string, params string [] object ), but allowing a collection of values to be supplied. More... | |
int | AppendToField (string name, params object[] values) |
Appends one or more values to a repeating field. More... | |
int | AppendToField< T > (string name, ICollection< T > values) |
Appends one or more values to a repeating field. More... | |
string | GetField (string name) |
Gets a field value by name. More... | |
string | GetField (int index) |
Returns a specific field value within the record. More... | |
string | GetField (string name, int index) |
Get the value of a specified occurrence of a repeating field. More... | |
List< string > | GetFields () |
Returns the values of all field occurrences within the record. More... | |
List< string > | GetFieldValues (string name) |
Gets a list of field values. More... | |
List< object > | GetMappedFields () |
This returns the fields of the record in a format mapped to the record metadata. More... | |
int | Size () |
Returns the number of field values within the record. More... | |
int | SizeInBytes () |
Returns the number of bytes that this record would occupy in a DataMessage that uses the default character set for byte encoding. More... | |
int | SizeInBytes (System.Text.Encoding encoding) |
Returns the number of bytes that this record would occupy in a DataMessage that uses a specified character set for byte endoing. More... | |
int | SizeInChars () |
Returns the total number of characters within this record (including delimiters). More... | |
override string | ToString () |
Returns the string representation of this object. More... | |
Properties | |
MRecordImpl | MetaData [get, set] |
Metadata to initialise and police the data - may be null for free for all processing. More... | |
A message record.
PushTechnology.DiffusionCore.Messaging.Record.Record | ( | IMRecord | metadata, |
params string[] | fields | ||
) |
metadata | |
fields |
PushTechnology.DiffusionCore.Messaging.Record.Record | ( | params string[] | fields | ) |
Create a free-format record with zero or more fields.
fields | Optional variable-length number of field values. |
void PushTechnology.DiffusionCore.Messaging.Record.AddField | ( | int | index, |
string | field | ||
) |
Inserts a field at a specified index within the record, moving subsequent fields along the record.
This can only be used for free-format records (i.e. those without metadata).
index | The index to add a field at. |
field | The field to add. |
void PushTechnology.DiffusionCore.Messaging.Record.AddFields | ( | params string[] | fields | ) |
Adds one or more fields to the end of the record.
This can only be used for free-format records (i.e. those without metadata).
fields | A list of fields to add. |
void PushTechnology.DiffusionCore.Messaging.Record.AddFields< T > | ( | ICollection< T > | fields | ) |
Adds one or more fields to the end of the record.
A collection of any type may be supplied and the ToString() value of each object will be used as the string value.
If any field value is null, it will be written as an empty field (i.e. a zero-length string).
This can only be used for free-format records (i.e. those without metadata).
T |
fields | The collection of field objects to add. |
int PushTechnology.DiffusionCore.Messaging.Record.AppendToField | ( | string | name, |
params object[] | values | ||
) |
Appends one or more values to a repeating field.
This can only be used for a record that has metadata and for a Multiplicity.IsRepeating multiplicity field.
Adding the values must not cause the Multiplicity.Maximum number of values to be exceeded.
name | The field name. |
values | The value or values which are parsed according to the data type as specified in the metadata. If null or no values supplied then this call has no effect. |
int PushTechnology.DiffusionCore.Messaging.Record.AppendToField< T > | ( | string | name, |
ICollection< T > | values | ||
) |
Appends one or more values to a repeating field.
This can only be used for a record that has metadata and for a Multiplicity.IsRepeating multiplicity field.
Adding the values must not cause the Multiplicity.Maximum number of values to be exceeded.
T |
name | The field name. |
values | The value or values which are parsed according to the data type as specified in the metadata. If null or no values supplied then this call has no effect. |
string PushTechnology.DiffusionCore.Messaging.Record.GetField | ( | string | name | ) |
Gets a field value by name.
This can only be used for records with metadata and for a non-repeating field.
name | The field name. |
string PushTechnology.DiffusionCore.Messaging.Record.GetField | ( | int | index | ) |
Returns a specific field value within the record.
index | The index of the field to return the value for, starting at 0. |
string PushTechnology.DiffusionCore.Messaging.Record.GetField | ( | string | name, |
int | index | ||
) |
Get the value of a specified occurrence of a repeating field.
This can only be used for a record that has metadata and for a field that is declared as repeating.
name | The name of the field. |
index | The index of the field value occurrence to return the value for. |
List<string> PushTechnology.DiffusionCore.Messaging.Record.GetFields | ( | ) |
Returns the values of all field occurrences within the record.
List<string> PushTechnology.DiffusionCore.Messaging.Record.GetFieldValues | ( | string | name | ) |
Gets a list of field values.
This can only be used for records with metadata.
If the field is a repeating field then all of its current values will be returned (this could be empty for a final variable repeating field). If the field is non-repeating then a list containing the single value will be returned.
name |
List<object> PushTechnology.DiffusionCore.Messaging.Record.GetMappedFields | ( | ) |
This returns the fields of the record in a format mapped to the record metadata.
Each entry in the returned list represents a field entry in the metadata associated with the record.
string PushTechnology.DiffusionCore.Messaging.Record.RemoveField | ( | int | index | ) |
index |
void PushTechnology.DiffusionCore.Messaging.Record.SetField | ( | int | index, |
string | field | ||
) |
Replaces a field at a specified index within the record.
This can only be used for free-format records (i.e. those without metadata).
index | The index of the field to replace. |
field | The new field. |
void PushTechnology.DiffusionCore.Messaging.Record.SetField | ( | string | name, |
params object[] | values | ||
) |
Set field value(s) by name.
This can only be used for a record that has metadata.
When used for a Multiplicity.IsSingle multiplicity field only a single value may be specified. If no value (or null) is specified then the field will set to the default value as indicated by the metadata.
When used for a Multiplicity.IsRepeating multiplicity field then multiple values may be specified. No more than the Multiplicity.Maximum number of values may be supplied.
name | The field name. |
values | The value or values which are parsed according to the data type as specified in the metadata. Specifying no values will cause the field to be initialised to defaults (repeating fields will have the minimum number of occurrences set to default). A null value is also interpreted as default. |
void PushTechnology.DiffusionCore.Messaging.Record.SetField | ( | string | name, |
int | index, | ||
object | value | ||
) |
Sets a field value by name and index.
This can only be used for a record that has metadata and for a Multiplicity.IsRepeating multiplicity field.
name | The name of the field. |
index | The index of the field occurrence to set. |
value | The new field value which is parsed according to the data type indicated by the metadata. null is interpreted as the default value for the field as indicated by the metadata. |
void PushTechnology.DiffusionCore.Messaging.Record.SetFieldValues< T > | ( | string | name, |
ICollection< T > | values | ||
) |
As SetField( string, params string [] object ), but allowing a collection of values to be supplied.
T |
name | The field name. |
values | The value or values which are parsed according to the data type as specified in the metadata. Specifying no values will cause the field to be initialised to defaults (repeating fields will have the minimum number of occurrences set to default). A null value is also interpreted as default. |
int PushTechnology.DiffusionCore.Messaging.Record.Size | ( | ) |
Returns the number of field values within the record.
int PushTechnology.DiffusionCore.Messaging.Record.SizeInBytes | ( | ) |
Returns the number of bytes that this record would occupy in a DataMessage that uses the default character set for byte encoding.
int PushTechnology.DiffusionCore.Messaging.Record.SizeInBytes | ( | System.Text.Encoding | encoding | ) |
Returns the number of bytes that this record would occupy in a DataMessage that uses a specified character set for byte endoing.
encoding | The encoding. |
int PushTechnology.DiffusionCore.Messaging.Record.SizeInChars | ( | ) |
Returns the total number of characters within this record (including delimiters).
This can be used as a more efficient way of determining the size that the record would occupy within a DataMessage than using SizeInBytes() when it is known that the record only contains ASCII characters.
override string PushTechnology.DiffusionCore.Messaging.Record.ToString | ( | ) |
Returns the string representation of this object.
|
getset |
Metadata to initialise and police the data - may be null for free for all processing.