/
krasninja
/
querycat
Обзор
Документация
Войти
/
krasninja
/
querycat
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
sdk/dotnet-sdk/ObjectValue.cs
217 строк
6 KB
Ivan Kozhin
Update Apache Thrift
06 сен 2023, 15:00
06 сен 2023, 15:00
5513441
Код
Авторство
О чём код?
/** * Autogenerated by Thrift Compiler (0.19.0) * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING */ 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; #nullable enable // requires C# 8.0 #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 namespace QueryCat.Plugins.Sdk { public partial class ObjectValue : TBase { /// <summary> /// /// <seealso cref="global::QueryCat.Plugins.Sdk.ObjectType"/> /// </summary> public global::QueryCat.Plugins.Sdk.ObjectType Type { get; set; } = default; public int Handle { get; set; } = 0; public string Name { get; set; } = string.Empty; public ObjectValue() { } public ObjectValue(global::QueryCat.Plugins.Sdk.ObjectType @type, int @handle, string @name) : this() { this.Type = @type; this.Handle = @handle; this.Name = @name; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { bool isset_type = false; bool isset_handle = false; bool isset_name = false; 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.I32) { Type = (global::QueryCat.Plugins.Sdk.ObjectType)await iprot.ReadI32Async(cancellationToken); isset_type = true; } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 2: if (field.Type == TType.I32) { Handle = await iprot.ReadI32Async(cancellationToken); isset_handle = true; } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 3: if (field.Type == TType.String) { Name = await iprot.ReadStringAsync(cancellationToken); isset_name = true; } 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); if (!isset_type) { throw new TProtocolException(TProtocolException.INVALID_DATA); } if (!isset_handle) { throw new TProtocolException(TProtocolException.INVALID_DATA); } if (!isset_name) { throw new TProtocolException(TProtocolException.INVALID_DATA); } } finally { iprot.DecrementRecursionDepth(); } } public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var tmp4 = new TStruct("ObjectValue"); await oprot.WriteStructBeginAsync(tmp4, cancellationToken); var tmp5 = new TField(); tmp5.Name = "type"; tmp5.Type = TType.I32; tmp5.ID = 1; await oprot.WriteFieldBeginAsync(tmp5, cancellationToken); await oprot.WriteI32Async((int)Type, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); tmp5.Name = "handle"; tmp5.Type = TType.I32; tmp5.ID = 2; await oprot.WriteFieldBeginAsync(tmp5, cancellationToken); await oprot.WriteI32Async(Handle, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); if((Name != null)) { tmp5.Name = "name"; tmp5.Type = TType.String; tmp5.ID = 3; await oprot.WriteFieldBeginAsync(tmp5, cancellationToken); await oprot.WriteStringAsync(Name, 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 not ObjectValue other) return false; if (ReferenceEquals(this, other)) return true; return global::System.Object.Equals(Type, other.Type) && global::System.Object.Equals(Handle, other.Handle) && global::System.Object.Equals(Name, other.Name); } public override int GetHashCode() { int hashcode = 157; unchecked { hashcode = (hashcode * 397) + Type.GetHashCode(); hashcode = (hashcode * 397) + Handle.GetHashCode(); if((Name != null)) { hashcode = (hashcode * 397) + Name.GetHashCode(); } } return hashcode; } public override string ToString() { var tmp6 = new StringBuilder("ObjectValue("); tmp6.Append(", Type: "); Type.ToString(tmp6); tmp6.Append(", Handle: "); Handle.ToString(tmp6); if((Name != null)) { tmp6.Append(", Name: "); Name.ToString(tmp6); } tmp6.Append(')'); return tmp6.ToString(); } } }