Diffusion .NET Client Library  6.1.5
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
PushTechnology.ClientInterface.Client.Content.Metadata.IRecordStructuredBuilder Interface Reference

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...
 

Detailed Description

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.

Member Function Documentation

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.

Parameters
nameThe field name.
valuesThe 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.
Returns
This builder.
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.

Parameters
nameThe field name.
valuesThe 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.
Returns
This builder.
IRecord PushTechnology.ClientInterface.Client.Content.Metadata.IRecordStructuredBuilder.Build ( )

Builds the record.

Returns
The new 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.

Parameters
valueThe empty field value.
Returns
This builder.
IRecordStructuredBuilder PushTechnology.ClientInterface.Client.Content.Metadata.IRecordStructuredBuilder.Reset ( )

Resets the builder to its initial state.

Returns
This builder.
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.

Parameters
nameThe field name.
valuesThe 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.
Returns
This builder.
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.

Parameters
nameThe field name.
valuesThe 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.
Returns
IRecordStructuredBuilder PushTechnology.ClientInterface.Client.Content.Metadata.IRecordStructuredBuilder.Set ( string  name,
int  index,
object  value 
)

Sets a field name value by name and index.

Parameters
nameThe field name.
indexThe index of the field occurrence to set.
valueThe 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.
Returns
This builder.

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