Beispiel #1
0
        public override string ToString()
        {
            var  sb      = new StringBuilder("TimeUnit(");
            bool __first = true;

            if (MILLIS != null && __isset.MILLIS)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("MILLIS: ");
                sb.Append(MILLIS == null ? "<null>" : MILLIS.ToString());
            }
            if (MICROS != null && __isset.MICROS)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("MICROS: ");
                sb.Append(MICROS == null ? "<null>" : MICROS.ToString());
            }
            sb.Append(")");
            return(sb.ToString());
        }
Beispiel #2
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("TimeUnit");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (MILLIS != null && __isset.MILLIS)
         {
             field.Name = "MILLIS";
             field.Type = TType.Struct;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             MILLIS.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (MICROS != null && __isset.MICROS)
         {
             field.Name = "MICROS";
             field.Type = TType.Struct;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             MICROS.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (NANOS != null && __isset.NANOS)
         {
             field.Name = "NANOS";
             field.Type = TType.Struct;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             NANOS.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }
Beispiel #3
0
        public async Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
        {
            oprot.IncrementRecursionDepth();
            try
            {
                var struc = new TStruct("TimeUnit");
                await oprot.WriteStructBeginAsync(struc, cancellationToken);

                var field = new TField();
                if (MILLIS != null && __isset.MILLIS)
                {
                    field.Name = "MILLIS";
                    field.Type = TType.Struct;
                    field.ID   = 1;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await MILLIS.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (MICROS != null && __isset.MICROS)
                {
                    field.Name = "MICROS";
                    field.Type = TType.Struct;
                    field.ID   = 2;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await MICROS.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                await oprot.WriteFieldStopAsync(cancellationToken);

                await oprot.WriteStructEndAsync(cancellationToken);
            }
            finally
            {
                oprot.DecrementRecursionDepth();
            }
        }