Avro C#
Public Member Functions | Protected Member Functions | Properties
Avro::UnionSchema Class Reference

Class for union schemas. More...

Inheritance diagram for Avro::UnionSchema:
Avro::UnnamedSchema Avro::Schema

List of all members.

Public Member Functions

int MatchingBranch (Schema s)
 Returns the index of a branch that can read the data written by the given schema s.
override bool CanRead (Schema writerSchema)
 Checks if this schema can read data written by the given schema. Used for decoding data.
override bool Equals (object obj)
 Compares two union schema objects.
override int GetHashCode ()
 Hash code function.

Protected Member Functions

internal override void WriteJson (Newtonsoft.Json.JsonTextWriter writer, SchemaNames names, string encspace)
 Writes union schema in JSON format.

Properties

IList< SchemaSchemas [get, set]
 List of schemas in the union.
int Count [get]
 Count of schemas in the union.
Schema this[int index] [get]
 Returns the schema at the given branch.

Detailed Description

Class for union schemas.


Member Function Documentation

override bool Avro::UnionSchema::CanRead ( Schema  writerSchema) [inline, virtual]

Checks if this schema can read data written by the given schema. Used for decoding data.

Parameters:
writerSchemawriter schema
Returns:
true if this and writer schema are compatible based on the AVRO specification, false otherwise

Reimplemented from Avro::Schema.

override bool Avro::UnionSchema::Equals ( object  obj) [inline]

Compares two union schema objects.

Parameters:
objunion schema object to compare against this schema
Returns:
true if objects are equal, false otherwise
override int Avro::UnionSchema::GetHashCode ( ) [inline]

Hash code function.

Returns:

Reimplemented from Avro::Schema.

int Avro::UnionSchema::MatchingBranch ( Schema  s) [inline]

Returns the index of a branch that can read the data written by the given schema s.

Parameters:
sThe schema to match the branches against.
Returns:
The index of the matching branch. If non matches a -1 is returned.
internal override void Avro::UnionSchema::WriteJson ( Newtonsoft.Json.JsonTextWriter  writer,
SchemaNames  names,
string  encspace 
) [inline, protected]

Writes union schema in JSON format.

Parameters:
writerJSON writer
nameslist of named schemas already written
encspaceenclosing namespace of the schema

Property Documentation

int Avro::UnionSchema::Count [get]

Count of schemas in the union.

IList<Schema> Avro::UnionSchema::Schemas [get, set]

List of schemas in the union.

Schema Avro::UnionSchema::this[int index] [get]

Returns the schema at the given branch.

Parameters:
indexIndex to the branch, starting with 0.
Returns:
The branch corresponding to the given index.

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties