forked from confluentinc/confluent-kafka-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUser.cs
85 lines (84 loc) · 2.71 KB
/
User.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// ------------------------------------------------------------------------------
// <auto-generated>
// Generated by avrogen.exe, version 1.0.0.0
// Changes to this file may cause incorrect behavior and will be lost if code
// is regenerated
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Confluent.Kafka.Examples.AvroSpecific
{
using System;
using System.Collections.Generic;
using System.Text;
using global::Avro;
using global::Avro.Specific;
public partial class User : ISpecificRecord
{
public static Schema _SCHEMA = Schema.Parse("{\"type\":\"record\",\"name\":\"User\",\"namespace\":\"Confluent.Kafka.Examples.AvroSpecific" +
"\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"favorite_number\",\"type\":[\"i" +
"nt\",\"null\"]},{\"name\":\"favorite_color\",\"type\":[\"string\",\"null\"]}]}");
private string _name;
private System.Nullable<int> _favorite_number;
private string _favorite_color;
public virtual Schema Schema
{
get
{
return User._SCHEMA;
}
}
public string name
{
get
{
return this._name;
}
set
{
this._name = value;
}
}
public System.Nullable<int> 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 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<int>)fieldValue; break;
case 2: this.favorite_color = (System.String)fieldValue; break;
default: throw new AvroRuntimeException("Bad index " + fieldPos + " in Put()");
};
}
}
}