Class RecordSchema
Class for record schemas
Inherited Members
Namespace: Avro
Assembly: Avro.dll
Syntax
public class RecordSchema : NamedSchema
Properties
| Improve this Doc View SourceCount
Number of fields in the record
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Fields
List of fields in the record
Declaration
public List<Field> Fields { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Field> |
Item[String]
Returns the field with the given name.
Declaration
public Field this[string name] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | name | field name |
Property Value
Type | Description |
---|---|
Field | Field object |
Methods
| Improve this Doc View SourceCanRead(Schema)
Checks if this schema can read data written by the given schema. Used for decoding data.
Declaration
public override bool CanRead(Schema writerSchema)
Parameters
Type | Name | Description |
---|---|---|
Schema | writerSchema | writer schema |
Returns
Type | Description |
---|---|
System.Boolean | true if this and writer schema are compatible based on the AVRO specification, false otherwise |
Overrides
| Improve this Doc View SourceContains(String)
Returns true if and only if the record contains a field by the given name.
Declaration
public bool Contains(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | The name of the field |
Returns
Type | Description |
---|---|
System.Boolean | true if the field exists, false otherwise |
Equals(Object)
Compares equality of two record schemas
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | record schema to compare against this schema |
Returns
Type | Description |
---|---|
System.Boolean | true if the two schemas are equal, false otherwise |
Overrides
GetEnumerator()
Returns an enumerator which enumerates over the fields of this record schema
Declaration
public IEnumerator<Field> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<Field> | Enumerator over the field in the order of their definition |
GetHashCode()
Hash code function
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
| Improve this Doc View SourceTryGetField(String, out Field)
Declaration
public bool TryGetField(string fieldName, out Field field)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | |
Field | field |
Returns
Type | Description |
---|---|
System.Boolean |
TryGetFieldAlias(String, out Field)
Declaration
public bool TryGetFieldAlias(string fieldName, out Field field)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | |
Field | field |
Returns
Type | Description |
---|---|
System.Boolean |
WriteJsonFields(JsonTextWriter, SchemaNames, String)
Writes the records schema in JSON format
Declaration
protected override void WriteJsonFields(JsonTextWriter writer, SchemaNames names, string encspace)
Parameters
Type | Name | Description |
---|---|---|
Newtonsoft.Json.JsonTextWriter | writer | JSON writer |
SchemaNames | names | list of named schemas already written |
System.String | encspace | enclosing namespace of the record schema |