Diffusion .NET Client Library
6.1.5
|
The interface for a record builder that uses IMRecord metadata. More...
Inherited by PushTechnology.ClientInterface.Client.Content.RecordStructuredBuilder.
Public Member Functions | |
IRecordStructuredBuilder | Set (string name, params object[] values) |
Set field value(s) by name. More... | |
IRecordStructuredBuilder | Set (string name, ICollection< object > values) |
As Set( string, object[] ) but allowing a collection of values to be supplied. More... | |
IRecordStructuredBuilder | Add (string name, params object[] values) |
Appends one or more values to a repeating field. More... | |
IRecordStructuredBuilder | Add (string name, ICollection< object > values) |
Appends one or more values to a repeating field. More... | |
IRecordStructuredBuilder | Set (string name, int index, object value) |
Sets a field name value by name and index. More... | |
IRecordStructuredBuilder | EmptyFieldValue (string value) |
Sets the value to be used to indicate empty fields. More... | |
IRecordStructuredBuilder | Reset () |
Resets the builder to its initial state. More... | |
IRecord | Build () |
Builds the record. More... | |
The interface for a record builder that uses IMRecord metadata.
Such a builder can be created using IRecordFactory.NewRecordBuilder( IMRecord ).
A single builder may be used to build any number of records and after a build, all previously-set values are retained.
Initially all fields will be set to initial values as described by the metadata. Field values may then be changed to any values permitted by the metadata.
If a metadata field IMString.AllowsEmpty allows an empty value then it may be set to either a zero-length string or the Constants.EMPTY_FIELD_CHAR default empty field value. A different empty field value may be specified using EmptyFieldValue.
IRecordStructuredBuilder PushTechnology.ClientInterface.Client.Content.Metadata.IRecordStructuredBuilder.Add | ( | string | name, |
params object[] | values | ||
) |
Appends one or more values to a repeating field.
This can only be used 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. |
IRecordStructuredBuilder PushTechnology.ClientInterface.Client.Content.Metadata.IRecordStructuredBuilder.Add | ( | string | name, |
ICollection< object > | values | ||
) |
Appends one or more values to a repeating field.
This is equivalent to Set(string, object[]) but with a collection of values.
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. |
IRecord PushTechnology.ClientInterface.Client.Content.Metadata.IRecordStructuredBuilder.Build | ( | ) |
Builds the record.
IRecordStructuredBuilder PushTechnology.ClientInterface.Client.Content.Metadata.IRecordStructuredBuilder.EmptyFieldValue | ( | string | value | ) |
Sets the value to be used to indicate empty fields.
When a field indicates that it allows an empty value then this may be used to specify what that value is. Setting of non-string field values will therefore allow this value.
If not explicitly set, the empty field value is assumed to be "" (zero-length string) to match the default for record topics. However, this should be changed to whatever is used for the target topic.
value | The empty field value. |
IRecordStructuredBuilder PushTechnology.ClientInterface.Client.Content.Metadata.IRecordStructuredBuilder.Reset | ( | ) |
Resets the builder to its initial state.
IRecordStructuredBuilder PushTechnology.ClientInterface.Client.Content.Metadata.IRecordStructuredBuilder.Set | ( | string | name, |
params object[] | values | ||
) |
Set field value(s) by name.
When used for a Multiplicity.IsSingle single multiplicity field, only a single value may be specified. If no value (or null) is specified then the field will be 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. |
IRecordStructuredBuilder PushTechnology.ClientInterface.Client.Content.Metadata.IRecordStructuredBuilder.Set | ( | string | name, |
ICollection< object > | values | ||
) |
As Set( string, object[] ) but allowing a collection of values to 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. |
IRecordStructuredBuilder PushTechnology.ClientInterface.Client.Content.Metadata.IRecordStructuredBuilder.Set | ( | string | name, |
int | index, | ||
object | value | ||
) |
Sets a field name value by name and index.
name | The field name. |
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. |