Show / Hide Table of Contents

Class UnionSchema

Class for union schemas

Inheritance
System.Object
Schema
UnnamedSchema
UnionSchema
Inherited Members
UnnamedSchema.Name
Schema.Tag
Schema.Parse(String)
Schema.ToString()
Schema.GetTypeString(Schema.Type)
Schema.WriteJsonFields(JsonTextWriter, SchemaNames, String)
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 UnionSchema : UnnamedSchema

Properties

| Improve this Doc View Source

Count

Count of schemas in the union

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

Item[Int32]

Returns the schema at the given branch.

Declaration
public Schema this[int index] { get; }
Parameters
Type Name Description
System.Int32 index

Index to the branch, starting with 0.

Property Value
Type Description
Schema

The branch corresponding to the given index.

| Improve this Doc View Source

Schemas

List of schemas in the union

Declaration
public IList<Schema> Schemas { get; }
Property Value
Type Description
System.Collections.Generic.IList<Schema>

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

Equals(Object)

Compares two union schema objects

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

union schema object to compare against this schema

Returns
Type Description
System.Boolean

true if objects are equal, false otherwise

Overrides
System.Object.Equals(System.Object)
| 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

MatchingBranch(Schema)

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

Declaration
public int MatchingBranch(Schema s)
Parameters
Type Name Description
Schema s

The schema to match the branches against.

Returns
Type Description
System.Int32

The index of the matching branch. If non matches a -1 is returned.

| Improve this Doc View Source

WriteJson(JsonTextWriter, SchemaNames, String)

Writes union schema in JSON format

Declaration
protected override void WriteJson(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 schema

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