Write() 공개 메소드

public Write ( TProtocol oprot ) : void
oprot Thrift.Protocol.TProtocol
리턴 void
예제 #1
0
        public void Write(TProtocol oprot)
        {
            TStruct struc = new TStruct("ContactRegistration");

            oprot.WriteStructBegin(struc);
            TField field = new TField();

            if (Contact != null && __isset.contact)
            {
                field.Name = "contact";
                field.Type = TType.Struct;
                field.ID   = 1;
                oprot.WriteFieldBegin(field);
                Contact.Write(oprot);
                oprot.WriteFieldEnd();
            }
            if (Luid != null && __isset.luid)
            {
                field.Name = "luid";
                field.Type = TType.String;
                field.ID   = 10;
                oprot.WriteFieldBegin(field);
                oprot.WriteString(Luid);
                oprot.WriteFieldEnd();
            }
            if (__isset.contactType)
            {
                field.Name = "contactType";
                field.Type = TType.I32;
                field.ID   = 11;
                oprot.WriteFieldBegin(field);
                oprot.WriteI32((int)ContactType);
                oprot.WriteFieldEnd();
            }
            if (ContactKey != null && __isset.contactKey)
            {
                field.Name = "contactKey";
                field.Type = TType.String;
                field.ID   = 12;
                oprot.WriteFieldBegin(field);
                oprot.WriteString(ContactKey);
                oprot.WriteFieldEnd();
            }
            oprot.WriteFieldStop();
            oprot.WriteStructEnd();
        }
        public void Write(TProtocol oprot)
        {
            TStruct struc = new TStruct("SnsFriendContactRegistration");

            oprot.WriteStructBegin(struc);
            TField field = new TField();

            if (Contact != null && __isset.contact)
            {
                field.Name = "contact";
                field.Type = TType.Struct;
                field.ID   = 1;
                oprot.WriteFieldBegin(field);
                Contact.Write(oprot);
                oprot.WriteFieldEnd();
            }
            if (__isset.snsIdType)
            {
                field.Name = "snsIdType";
                field.Type = TType.I32;
                field.ID   = 2;
                oprot.WriteFieldBegin(field);
                oprot.WriteI32((int)SnsIdType);
                oprot.WriteFieldEnd();
            }
            if (SnsUserId != null && __isset.snsUserId)
            {
                field.Name = "snsUserId";
                field.Type = TType.String;
                field.ID   = 3;
                oprot.WriteFieldBegin(field);
                oprot.WriteString(SnsUserId);
                oprot.WriteFieldEnd();
            }
            oprot.WriteFieldStop();
            oprot.WriteStructEnd();
        }