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

Class for enum type schemas. More...

Inheritance diagram for Avro::EnumSchema:
Avro::NamedSchema Avro::Schema

List of all members.

Public Member Functions

int Ordinal (string symbol)
 Returns the position of the given symbol within this enum. Throws AvroException if the symbol is not found in this enum.
bool Contains (string symbol)
 Checks if given symbol is in the list of enum symbols.
IEnumerator< string > GetEnumerator ()
 Returns an enumerator that enumerates the symbols in this enum schema in the order of their definition.
override bool Equals (object obj)
 Checks equality of two enum schema.
override int GetHashCode ()
 Hashcode function.
override bool CanRead (Schema writerSchema)
 Checks if this schema can read data written by the given schema. Used for decoding data.

Protected Member Functions

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

Properties

IList< string > Symbols [get, set]
 List of strings representing the enum symbols.
int Count [get]
 Count of enum symbols.
string this[int index] [get]
 Returns the enum symbol of the given index to the list.

Detailed Description

Class for enum type schemas.


Member Function Documentation

override bool Avro::EnumSchema::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.

bool Avro::EnumSchema::Contains ( string  symbol) [inline]

Checks if given symbol is in the list of enum symbols.

Parameters:
symbolsymbol to check
Returns:
true if symbol exist, false otherwise
override bool Avro::EnumSchema::Equals ( object  obj) [inline]

Checks equality of two enum schema.

Parameters:
obj
Returns:
IEnumerator<string> Avro::EnumSchema::GetEnumerator ( ) [inline]

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

Returns:
Enumeration over the symbols of this enum schema
override int Avro::EnumSchema::GetHashCode ( ) [inline]

Hashcode function.

Returns:

Reimplemented from Avro::Schema.

int Avro::EnumSchema::Ordinal ( string  symbol) [inline]

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

Parameters:
symbolname of the symbol to find
Returns:
position of the given symbol in this enum schema
internal override void Avro::EnumSchema::WriteJsonFields ( Newtonsoft.Json.JsonTextWriter  writer,
SchemaNames  names,
string  encspace 
) [inline, protected]

Writes enum schema in JSON format.

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

Reimplemented from Avro::NamedSchema.


Property Documentation

int Avro::EnumSchema::Count [get]

Count of enum symbols.

IList<string> Avro::EnumSchema::Symbols [get, set]

List of strings representing the enum symbols.

string Avro::EnumSchema::this[int index] [get]

Returns the enum symbol of the given index to the list.

Parameters:
indexsymbol index
Returns:
symbol name

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