Show / Hide Table of Contents

Class EnumSchema

Class for enum type schemas

Inheritance
System.Object
Schema
NamedSchema
EnumSchema
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 EnumSchema : NamedSchema

Properties

| Improve this Doc View Source

Count

Count of enum symbols

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

Item[Int32]

Returns the enum symbol of the given index to the list

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

symbol index

Property Value
Type Description
System.String

symbol name

| Improve this Doc View Source

Symbols

List of strings representing the enum symbols

Declaration
public IList<string> Symbols { get; }
Property Value
Type Description
System.Collections.Generic.IList<System.String>

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)

Checks if given symbol is in the list of enum symbols

Declaration
public bool Contains(string symbol)
Parameters
Type Name Description
System.String symbol

symbol to check

Returns
Type Description
System.Boolean

true if symbol exist, false otherwise

| Improve this Doc View Source

Equals(Object)

Checks equality of two enum schema

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean
Overrides
System.Object.Equals(System.Object)
| Improve this Doc View Source

GetEnumerator()

Returns an enumerator that enumerates the symbols in this enum schema in the order of their definition.

Declaration
public IEnumerator<string> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<System.String>

Enumeration over the symbols of this enum schema

| Improve this Doc View Source

GetHashCode()

Hashcode function

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

Ordinal(String)

Returns the position of the given symbol within this enum. Throws AvroException if the symbol is not found in this enum.

Declaration
public int Ordinal(string symbol)
Parameters
Type Name Description
System.String symbol

name of the symbol to find

Returns
Type Description
System.Int32

position of the given symbol in this enum schema

| Improve this Doc View Source

WriteJsonFields(JsonTextWriter, SchemaNames, String)

Writes enum 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 schema already written

System.String encspace

enclosing namespace of the enum schema

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