2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-06-13 14:38:43 +00:00
Files
esiur-dotnet/Tests/RPC/Client/Model/Thrift/ExtEntry.cs
T
2026-06-08 16:15:57 +03:00

230 lines
6.1 KiB
C#

/**
* <auto-generated>
* Autogenerated by Thrift Compiler (0.19.0)
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* </auto-generated>
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Thrift;
using Thrift.Collections;
using Thrift.Protocol;
using Thrift.Protocol.Entities;
using Thrift.Protocol.Utilities;
using Thrift.Transport;
using Thrift.Transport.Client;
using Thrift.Transport.Server;
using Thrift.Processor;
#pragma warning disable IDE0079 // remove unnecessary pragmas
#pragma warning disable IDE0017 // object init can be simplified
#pragma warning disable IDE0028 // collection init can be simplified
#pragma warning disable IDE1006 // parts of the code use IDL spelling
#pragma warning disable CA1822 // empty DeepCopy() methods still non-static
#pragma warning disable IDE0083 // pattern matching "that is not SomeType" requires net5.0 but we still support earlier versions
namespace Echo.ThriftModel
{
public partial class ExtEntry : TBase
{
private string _key;
private global::Echo.ThriftModel.Variant _value;
public string Key
{
get
{
return _key;
}
set
{
__isset.@key = true;
this._key = value;
}
}
public global::Echo.ThriftModel.Variant Value
{
get
{
return _value;
}
set
{
__isset.@value = true;
this._value = value;
}
}
public Isset __isset;
public struct Isset
{
public bool @key;
public bool @value;
}
public ExtEntry()
{
}
public ExtEntry DeepCopy()
{
var tmp10 = new ExtEntry();
if((Key != null) && __isset.@key)
{
tmp10.Key = this.Key;
}
tmp10.__isset.@key = this.__isset.@key;
if((Value != null) && __isset.@value)
{
tmp10.Value = (global::Echo.ThriftModel.Variant)this.Value.DeepCopy();
}
tmp10.__isset.@value = this.__isset.@value;
return tmp10;
}
public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
{
iprot.IncrementRecursionDepth();
try
{
TField field;
await iprot.ReadStructBeginAsync(cancellationToken);
while (true)
{
field = await iprot.ReadFieldBeginAsync(cancellationToken);
if (field.Type == TType.Stop)
{
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.String)
{
Key = await iprot.ReadStringAsync(cancellationToken);
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 2:
if (field.Type == TType.Struct)
{
Value = new global::Echo.ThriftModel.Variant();
await Value.ReadAsync(iprot, cancellationToken);
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
default:
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
break;
}
await iprot.ReadFieldEndAsync(cancellationToken);
}
await iprot.ReadStructEndAsync(cancellationToken);
}
finally
{
iprot.DecrementRecursionDepth();
}
}
public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
{
oprot.IncrementRecursionDepth();
try
{
var tmp11 = new TStruct("ExtEntry");
await oprot.WriteStructBeginAsync(tmp11, cancellationToken);
var tmp12 = new TField();
if((Key != null) && __isset.@key)
{
tmp12.Name = "key";
tmp12.Type = TType.String;
tmp12.ID = 1;
await oprot.WriteFieldBeginAsync(tmp12, cancellationToken);
await oprot.WriteStringAsync(Key, cancellationToken);
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((Value != null) && __isset.@value)
{
tmp12.Name = "value";
tmp12.Type = TType.Struct;
tmp12.ID = 2;
await oprot.WriteFieldBeginAsync(tmp12, cancellationToken);
await Value.WriteAsync(oprot, cancellationToken);
await oprot.WriteFieldEndAsync(cancellationToken);
}
await oprot.WriteFieldStopAsync(cancellationToken);
await oprot.WriteStructEndAsync(cancellationToken);
}
finally
{
oprot.DecrementRecursionDepth();
}
}
public override bool Equals(object that)
{
if (!(that is ExtEntry other)) return false;
if (ReferenceEquals(this, other)) return true;
return ((__isset.@key == other.__isset.@key) && ((!__isset.@key) || (global::System.Object.Equals(Key, other.Key))))
&& ((__isset.@value == other.__isset.@value) && ((!__isset.@value) || (global::System.Object.Equals(Value, other.Value))));
}
public override int GetHashCode() {
int hashcode = 157;
unchecked {
if((Key != null) && __isset.@key)
{
hashcode = (hashcode * 397) + Key.GetHashCode();
}
if((Value != null) && __isset.@value)
{
hashcode = (hashcode * 397) + Value.GetHashCode();
}
}
return hashcode;
}
public override string ToString()
{
var tmp13 = new StringBuilder("ExtEntry(");
int tmp14 = 0;
if((Key != null) && __isset.@key)
{
if(0 < tmp14++) { tmp13.Append(", "); }
tmp13.Append("Key: ");
Key.ToString(tmp13);
}
if((Value != null) && __isset.@value)
{
if(0 < tmp14++) { tmp13.Append(", "); }
tmp13.Append("Value: ");
Value.ToString(tmp13);
}
tmp13.Append(')');
return tmp13.ToString();
}
}
}