Skip to content

Instantly share code, notes, and snippets.

@dbarkol
Created Jan 25, 2021
Embed
What would you like to do?
Generated class from Avro format
// ------------------------------------------------------------------------------
// <auto-generated>
// Generated by avrogen, version 1.10.0.0
// Changes to this file may cause incorrect behavior and will be lost if code
// is regenerated
// </auto-generated>
// ------------------------------------------------------------------------------
namespace zohan.schemaregistry.events
{
using System;
using System.Collections.Generic;
using System.Text;
using Avro;
using Avro.Specific;
public partial class CustomerLoyalty : ISpecificRecord
{
public static Schema _SCHEMA = Avro.Schema.Parse("{\"type\":\"record\",\"name\":\"CustomerLoyalty\",\"namespace\":\"zohan.schemaregistry.event" +
"s\",\"fields\":[{\"name\":\"CustomerId\",\"type\":\"int\"},{\"name\":\"PointsAdded\",\"type\":\"in" +
"t\"},{\"name\":\"Description\",\"type\":\"string\"}]}");
private int _CustomerId;
private int _PointsAdded;
private string _Description;
public virtual Schema Schema
{
get
{
return CustomerLoyalty._SCHEMA;
}
}
public int CustomerId
{
get
{
return this._CustomerId;
}
set
{
this._CustomerId = value;
}
}
public int PointsAdded
{
get
{
return this._PointsAdded;
}
set
{
this._PointsAdded = value;
}
}
public string Description
{
get
{
return this._Description;
}
set
{
this._Description = value;
}
}
public virtual object Get(int fieldPos)
{
switch (fieldPos)
{
case 0: return this.CustomerId;
case 1: return this.PointsAdded;
case 2: return this.Description;
default: throw new AvroRuntimeException("Bad index " + fieldPos + " in Get()");
};
}
public virtual void Put(int fieldPos, object fieldValue)
{
switch (fieldPos)
{
case 0: this.CustomerId = (System.Int32)fieldValue; break;
case 1: this.PointsAdded = (System.Int32)fieldValue; break;
case 2: this.Description = (System.String)fieldValue; break;
default: throw new AvroRuntimeException("Bad index " + fieldPos + " in Put()");
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment