Kinetica   C#   API  Version 7.2.3.1
AvroSchemaBuilder Class Reference

Builder for constructing Avro schema JSON strings. More...

Public Member Functions

 AvroSchemaBuilder (string name)
 Creates a new AvroSchemaBuilder with the specified record name. More...
 
AvroSchemaBuilder Namespace (string ns)
 Sets the namespace for the schema. More...
 
AvroSchemaBuilder Doc (string doc)
 Sets the documentation for the schema. More...
 
AvroSchemaBuilder Field (string name, AvroType type)
 Adds a field with the specified name and type. More...
 
AvroSchemaBuilder FieldWithDoc (string name, AvroType type, string doc)
 Adds a field with documentation. More...
 
AvroSchemaBuilder NullableField (string name, AvroType type)
 Adds a nullable field with the specified name and type. More...
 
AvroSchemaBuilder IntField (string name)
 Adds an integer field. More...
 
AvroSchemaBuilder LongField (string name)
 Adds a long field. More...
 
AvroSchemaBuilder FloatField (string name)
 Adds a float field. More...
 
AvroSchemaBuilder DoubleField (string name)
 Adds a double field. More...
 
AvroSchemaBuilder StringField (string name)
 Adds a string field. More...
 
AvroSchemaBuilder BoolField (string name)
 Adds a boolean field. More...
 
AvroSchemaBuilder BytesField (string name)
 Adds a bytes field. More...
 
AvroSchemaBuilder TimestampField (string name)
 Adds a timestamp field (long). More...
 
AvroSchemaBuilder NullableIntField (string name)
 Adds a nullable integer field. More...
 
AvroSchemaBuilder NullableLongField (string name)
 Adds a nullable long field. More...
 
AvroSchemaBuilder NullableFloatField (string name)
 Adds a nullable float field. More...
 
AvroSchemaBuilder NullableDoubleField (string name)
 Adds a nullable double field. More...
 
AvroSchemaBuilder NullableStringField (string name)
 Adds a nullable string field. More...
 
AvroSchemaBuilder NullableBoolField (string name)
 Adds a nullable boolean field. More...
 
AvroSchemaBuilder NullableBytesField (string name)
 Adds a nullable bytes field. More...
 
AvroSchemaBuilder NullableTimestampField (string name)
 Adds a nullable timestamp field. More...
 
string Build ()
 Builds the Avro schema JSON string. More...
 

Detailed Description

Builder for constructing Avro schema JSON strings.

Equivalent to Rust's AvroSchemaBuilder.

var schema = new AvroSchemaBuilder("SensorReading")
.Namespace("com.example")
.IntField("id")
.StringField("sensor_name")
.NullableDoubleField("value")
.LongField("timestamp")
.Build();

Definition at line 42 of file AvroSchemaBuilder.cs.

Constructor & Destructor Documentation

◆ AvroSchemaBuilder()

AvroSchemaBuilder.AvroSchemaBuilder ( string  name)
inline

Creates a new AvroSchemaBuilder with the specified record name.

Parameters
nameThe record type name.

Definition at line 53 of file AvroSchemaBuilder.cs.

Member Function Documentation

◆ BoolField()

AvroSchemaBuilder AvroSchemaBuilder.BoolField ( string  name)
inline

Adds a boolean field.

Definition at line 146 of file AvroSchemaBuilder.cs.

◆ Build()

string AvroSchemaBuilder.Build ( )
inline

Builds the Avro schema JSON string.

Definition at line 233 of file AvroSchemaBuilder.cs.

◆ BytesField()

AvroSchemaBuilder AvroSchemaBuilder.BytesField ( string  name)
inline

Adds a bytes field.

Definition at line 153 of file AvroSchemaBuilder.cs.

◆ Doc()

AvroSchemaBuilder AvroSchemaBuilder.Doc ( string  doc)
inline

Sets the documentation for the schema.

Definition at line 71 of file AvroSchemaBuilder.cs.

◆ DoubleField()

AvroSchemaBuilder AvroSchemaBuilder.DoubleField ( string  name)
inline

Adds a double field.

Definition at line 132 of file AvroSchemaBuilder.cs.

◆ Field()

AvroSchemaBuilder AvroSchemaBuilder.Field ( string  name,
AvroType  type 
)
inline

Adds a field with the specified name and type.

Definition at line 82 of file AvroSchemaBuilder.cs.

◆ FieldWithDoc()

AvroSchemaBuilder AvroSchemaBuilder.FieldWithDoc ( string  name,
AvroType  type,
string  doc 
)
inline

Adds a field with documentation.

Definition at line 91 of file AvroSchemaBuilder.cs.

◆ FloatField()

AvroSchemaBuilder AvroSchemaBuilder.FloatField ( string  name)
inline

Adds a float field.

Definition at line 125 of file AvroSchemaBuilder.cs.

◆ IntField()

AvroSchemaBuilder AvroSchemaBuilder.IntField ( string  name)
inline

Adds an integer field.

Definition at line 111 of file AvroSchemaBuilder.cs.

◆ LongField()

AvroSchemaBuilder AvroSchemaBuilder.LongField ( string  name)
inline

Adds a long field.

Definition at line 118 of file AvroSchemaBuilder.cs.

◆ Namespace()

AvroSchemaBuilder AvroSchemaBuilder.Namespace ( string  ns)
inline

Sets the namespace for the schema.

Definition at line 62 of file AvroSchemaBuilder.cs.

◆ NullableBoolField()

AvroSchemaBuilder AvroSchemaBuilder.NullableBoolField ( string  name)
inline

Adds a nullable boolean field.

Definition at line 206 of file AvroSchemaBuilder.cs.

◆ NullableBytesField()

AvroSchemaBuilder AvroSchemaBuilder.NullableBytesField ( string  name)
inline

Adds a nullable bytes field.

Definition at line 213 of file AvroSchemaBuilder.cs.

◆ NullableDoubleField()

AvroSchemaBuilder AvroSchemaBuilder.NullableDoubleField ( string  name)
inline

Adds a nullable double field.

Definition at line 192 of file AvroSchemaBuilder.cs.

◆ NullableField()

AvroSchemaBuilder AvroSchemaBuilder.NullableField ( string  name,
AvroType  type 
)
inline

Adds a nullable field with the specified name and type.

Definition at line 100 of file AvroSchemaBuilder.cs.

◆ NullableFloatField()

AvroSchemaBuilder AvroSchemaBuilder.NullableFloatField ( string  name)
inline

Adds a nullable float field.

Definition at line 185 of file AvroSchemaBuilder.cs.

◆ NullableIntField()

AvroSchemaBuilder AvroSchemaBuilder.NullableIntField ( string  name)
inline

Adds a nullable integer field.

Definition at line 171 of file AvroSchemaBuilder.cs.

◆ NullableLongField()

AvroSchemaBuilder AvroSchemaBuilder.NullableLongField ( string  name)
inline

Adds a nullable long field.

Definition at line 178 of file AvroSchemaBuilder.cs.

◆ NullableStringField()

AvroSchemaBuilder AvroSchemaBuilder.NullableStringField ( string  name)
inline

Adds a nullable string field.

Definition at line 199 of file AvroSchemaBuilder.cs.

◆ NullableTimestampField()

AvroSchemaBuilder AvroSchemaBuilder.NullableTimestampField ( string  name)
inline

Adds a nullable timestamp field.

Definition at line 220 of file AvroSchemaBuilder.cs.

◆ StringField()

AvroSchemaBuilder AvroSchemaBuilder.StringField ( string  name)
inline

Adds a string field.

Definition at line 139 of file AvroSchemaBuilder.cs.

◆ TimestampField()

AvroSchemaBuilder AvroSchemaBuilder.TimestampField ( string  name)
inline

Adds a timestamp field (long).

Definition at line 160 of file AvroSchemaBuilder.cs.


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