Show / Hide Table of Contents

Class RecordSchema

Class for record schemas

Inheritance
System.Object
Schema
NamedSchema
RecordSchema
Inherited Members
NamedSchema.SchemaName
NamedSchema.Name
NamedSchema.Namespace
NamedSchema.Fullname
NamedSchema.GetName(JToken, String)
NamedSchema.GetAliases(JToken, String, String)
NamedSchema.InAliases(SchemaName)
NamedSchema.WriteJson(JsonTextWriter, SchemaNames, String)
Schema.Tag
Schema.Parse(String)
Schema.ToString()
Schema.GetTypeString(Schema.Type)
Schema.GetProperty(String)
Schema.areEqual(Object, Object)
Schema.getHashCode(Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Avro
Assembly: Avro.dll
Syntax
public class RecordSchema : NamedSchema

Properties

| Improve this Doc View Source

Count

Number of fields in the record

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Fields

List of fields in the record

Declaration
public List<Field> Fields { get; }
Property Value
Type Description
System.Collections.Generic.List<Field>
| Improve this Doc View Source

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 Source

CanRead(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
Schema.CanRead(Schema)
| Improve this Doc View Source

Contains(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

| Improve this Doc View Source

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
System.Object.Equals(System.Object)
| Improve this Doc View Source

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

| Improve this Doc View Source

GetHashCode()

Hash code function

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
Schema.GetHashCode()
| Improve this Doc View Source

TryGetField(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
| Improve this Doc View Source

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
| Improve this Doc View Source

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

Overrides
NamedSchema.WriteJsonFields(JsonTextWriter, SchemaNames, String)
  • Improve this Doc
  • View Source
Back to top Copyright © 2012 The Apache Software Foundation.