You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2022/04/07 03:59:53 UTC

[GitHub] [avro] KyleSchoonover commented on pull request #1605: AVRO-3453: Add GeneratedCodeAttribute to generated code by avrogen

KyleSchoonover commented on PR #1605:
URL: https://github.com/apache/avro/pull/1605#issuecomment-1091054008

   ```
   // ------------------------------------------------------------------------------
   // <auto-generated>
   //    Generated by avrogen, version 1.12.0-SNAPSHOT
   //    Changes to this file may cause incorrect behavior and will be lost if code
   //    is regenerated
   // </auto-generated>
   // ------------------------------------------------------------------------------
   namespace AvroSample
   {
   	using System;
   	using System.Collections.Generic;
   	using System.Text;
   	using global::Avro;
   	using global::Avro.Specific;
   	
   	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("avrogen", "1.12.0-SNAPSHOT")]
   	public partial class User : global::Avro.Specific.ISpecificRecord
   	{
   		public static global::Avro.Schema _SCHEMA = global::Avro.Schema.Parse("{\"type\":\"record\",\"name\":\"User\",\"namespace\":\"AvroSample\",\"fields\":[{\"name\":\"name\"," +
   				"\"type\":\"string\"},{\"name\":\"favorite_number\",\"type\":[\"int\",\"null\"]},{\"name\":\"favor" +
   				"ite_color\",\"type\":[\"string\",\"null\"]}]}");
   		private string _name;
   		private System.Nullable<System.Int32> _favorite_number;
   		private string _favorite_color;
   		public virtual global::Avro.Schema Schema
   		{
   			get
   			{
   				return User._SCHEMA;
   			}
   		}
   		public string name
   		{
   			get
   			{
   				return this._name;
   			}
   			set
   			{
   				this._name = value;
   			}
   		}
   		public System.Nullable<System.Int32> favorite_number
   		{
   			get
   			{
   				return this._favorite_number;
   			}
   			set
   			{
   				this._favorite_number = value;
   			}
   		}
   		public string favorite_color
   		{
   			get
   			{
   				return this._favorite_color;
   			}
   			set
   			{
   				this._favorite_color = value;
   			}
   		}
   		public virtual object Get(int fieldPos)
   		{
   			switch (fieldPos)
   			{
   			case 0: return this.name;
   			case 1: return this.favorite_number;
   			case 2: return this.favorite_color;
   			default: throw new global::Avro.AvroRuntimeException("Bad index " + fieldPos + " in Get()");
   			};
   		}
   		public virtual void Put(int fieldPos, object fieldValue)
   		{
   			switch (fieldPos)
   			{
   			case 0: this.name = (System.String)fieldValue; break;
   			case 1: this.favorite_number = (System.Nullable<System.Int32>)fieldValue; break;
   			case 2: this.favorite_color = (System.String)fieldValue; break;
   			default: throw new global::Avro.AvroRuntimeException("Bad index " + fieldPos + " in Put()");
   			};
   		}
   	}
   }
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org