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

Builder to create an immutable ISchema. More...

Public Member Functions

ISchemaBuilder Record (string name)
 Adds a new single occurrence record to the schema. More...
 
ISchemaBuilder Record (string name, int occurs)
 Adds a new fixed multiplicity record to the schema. More...
 
ISchemaBuilder Record (string name, int min, int max)
 Adds a new record to the schema. More...
 
ISchemaBuilder String (string name)
 Adds a single occurrence string field to the current record. More...
 
ISchemaBuilder String (string name, int occurs)
 Adds a fixed multiplicity string field to the current record. More...
 
ISchemaBuilder String (string name, int min, int max)
 Adds a string field to the current record. More...
 
ISchemaBuilder Integer (string name)
 Adds a single occurrence integer field to the current record. More...
 
ISchemaBuilder Integer (string name, int occurs)
 Adds a fixed multiplicity integer field to the current record. More...
 
ISchemaBuilder Integer (string name, int min, int max)
 Adds an integer field to the current record. More...
 
ISchemaBuilder Decimal (string name, int scale)
 Adds a single occurrence decimal field to the current record. More...
 
ISchemaBuilder Decimal (string name, int scale, int occurs)
 Adds a fixed multiplicity decimal field to the current record. More...
 
ISchemaBuilder Decimal (string name, int scale, int min, int max)
 Adds a decimal field to the current record. More...
 
ISchema Build ()
 Builds an immutable ISchema. More...
 

Detailed Description

Builder to create an immutable ISchema.

A schema defines the records and fields that may occur in a RecordV2 topic value.

The schema must declare at least one record type and every record must have at least one field type declared.

Every record type and field type has a 'multiplicity' which defines the number of times that the record or field may occur within the data. Multiplicity is specified as a 'minimum' and 'maximum' number of occurrences or where the minimum and maximum are the same (fixed multiplicity) then the multiplicity may be specified as a single 'occurs' value. If the minimum and maximum are different, this is referred to a 'variable' multiplicity. Only the last record declared or the last field within a record may have variable multiplicity. The maximum value may be declared as -1 to indicate that the record or field can have an unlimited number of occurrences.

The builder is used to add a record definition followed by the fields within it. After all fields have been added to a record another may then be added, and so on, and then finally Build is called to create an immutable schema object.

Every call returns the builder instance allowing calls to be chained. A builder is obtained using the IRecordV2DataType.SchemaBuilder property.

Implemented in Version 6.0.

Member Function Documentation

ISchema PushTechnology.ClientInterface.Data.Record.Schema.ISchemaBuilder.Build ( )

Builds an immutable ISchema.

At least one record with at least one field must have been added to the builder.

Returns
The new immutable schema object representing the current state of the builder.
ISchemaBuilder PushTechnology.ClientInterface.Data.Record.Schema.ISchemaBuilder.Decimal ( string  name,
int  scale 
)

Adds a single occurrence decimal field to the current record.

This is the equivalent of calling Decimal(string, int, int) with the given scale and an occurs value of 1.

Parameters
nameThe field name.
scaleThe scale of the field (the number of decimal places). This must be a positive value.
Returns
The current builder instance.
ISchemaBuilder PushTechnology.ClientInterface.Data.Record.Schema.ISchemaBuilder.Decimal ( string  name,
int  scale,
int  occurs 
)

Adds a fixed multiplicity decimal field to the current record.

This is the equivalent of calling Decimal(string, int, int, int) with the given scale and a min and max value equal to occurs.

Parameters
nameThe field name.
scaleThe scale of the field (the number of decimal places). This must be a positive value.
occursThe fixed number of times the field should occur within the record. This must be positive.
Returns
The current builder instance.
ISchemaBuilder PushTechnology.ClientInterface.Data.Record.Schema.ISchemaBuilder.Decimal ( string  name,
int  scale,
int  min,
int  max 
)

Adds a decimal field to the current record.

A field may not be added after a field that has variable multiplicity (min != max).

Parameters
nameThe field name. This must not be the same as any field already added to the builder.
scaleThe scale of the field (the number of decimal places). This must be a positive value.
minThe minimum number of times the field may occur within the record. This must not be negative.
maxThe maximum number of times that the field may occur within the record. This must either be -1 (indicating no upper limit) or a positive value that is not less than min.
Returns
The current builder instance.
ISchemaBuilder PushTechnology.ClientInterface.Data.Record.Schema.ISchemaBuilder.Integer ( string  name)

Adds a single occurrence integer field to the current record.

This is the equivalent of calling Integer(string, int) with an occurs value of 1.

Parameters
nameThe field name.
Returns
The current builder instance.
ISchemaBuilder PushTechnology.ClientInterface.Data.Record.Schema.ISchemaBuilder.Integer ( string  name,
int  occurs 
)

Adds a fixed multiplicity integer field to the current record.

This is the equivalent of calling Integer(string, int, int) with a min and max value equal to occurs.

Parameters
nameThe field name.
occursThe fixed number of times the field should occur within the record. This must be positive.
Returns
The current builder instance.
ISchemaBuilder PushTechnology.ClientInterface.Data.Record.Schema.ISchemaBuilder.Integer ( string  name,
int  min,
int  max 
)

Adds an integer field to the current record.

A field may not be added after a field that has variable multiplicity (min != max).

Parameters
nameThe field name. This must not be the same as any field already added to the record.
minThe minimum number of times the field may occur within the record. This must not be negative.
maxThe maximum number of times that the field may occur within the record. This must either be -1 (indicating no upper limit) or a positive value that is not less than min.
Returns
The current builder instance.
ISchemaBuilder PushTechnology.ClientInterface.Data.Record.Schema.ISchemaBuilder.Record ( string  name)

Adds a new single occurrence record to the schema.

This is the equivalent to calling Record(string, int) with an occurs value of 1.

Parameters
nameThe record name.
Returns
The current builder instance.
ISchemaBuilder PushTechnology.ClientInterface.Data.Record.Schema.ISchemaBuilder.Record ( string  name,
int  occurs 
)

Adds a new fixed multiplicity record to the schema.

This is the equivalent to calling Record(string, int, int) with a min and max value equal to occurs.

Parameters
nameThe record name.
occursThe number of times the record is to occur. This must be a positive value.
Returns
The current builder instance.
ISchemaBuilder PushTechnology.ClientInterface.Data.Record.Schema.ISchemaBuilder.Record ( string  name,
int  min,
int  max 
)

Adds a new record to the schema.

The record added must not have the same name as a previously added record.

A record may not be added after a record with variable multiplicity.

A record may not be added directly after another record which has had no fields added.

Parameters
nameThe record name.
minThe minimum number of occurrences of the record. This must not be negative.
maxThe maximum number of occurrences of the record. This must either be -1 to indicate an unlimited number or it must be a positive number greater than or equal to min .
Returns
The current builder instance.
ISchemaBuilder PushTechnology.ClientInterface.Data.Record.Schema.ISchemaBuilder.String ( string  name)

Adds a single occurrence string field to the current record.

This is the equivalent of calling String(string, int) with an occurs value of 1.

Parameters
nameThe field name.
Returns
The current builder instance.
ISchemaBuilder PushTechnology.ClientInterface.Data.Record.Schema.ISchemaBuilder.String ( string  name,
int  occurs 
)

Adds a fixed multiplicity string field to the current record.

This is the equivalent of calling String(string, int, int) with a min and max value equal to occurs.

Parameters
nameThe field name.
occursThe fixed number of times the field should occur within the record. This must be positive.
Returns
The current builder instance.
ISchemaBuilder PushTechnology.ClientInterface.Data.Record.Schema.ISchemaBuilder.String ( string  name,
int  min,
int  max 
)

Adds a string field to the current record.

A field may not be added after a field that has variable multiplicity (min != max).

Parameters
nameThe field name. This must not be the same as any field already added to the record.
minThe minimum number of times the field may occur within the record. This must not be negative.
maxThe maximum number of times that the field may occur within the record. This must either be -1 (indicating no upper limit) or a positive value that is not less than min.
Returns
The current builder instance.

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