コード例 #1
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, NotificationEventResponse struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.events != null) {
        oprot.writeFieldBegin(EVENTS_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.events.size()));
          for (NotificationEvent _iter553 : struct.events) {
            _iter553.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
コード例 #2
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, NotificationEventResponse struct)
     throws org.apache.thrift.TException {
   org.apache.thrift.protocol.TField schemeField;
   iprot.readStructBegin();
   while (true) {
     schemeField = iprot.readFieldBegin();
     if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
       break;
     }
     switch (schemeField.id) {
       case 1: // EVENTS
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list550 = iprot.readListBegin();
             struct.events = new ArrayList<NotificationEvent>(_list550.size);
             NotificationEvent _elem551;
             for (int _i552 = 0; _i552 < _list550.size; ++_i552) {
               _elem551 = new NotificationEvent();
               _elem551.read(iprot);
               struct.events.add(_elem551);
             }
             iprot.readListEnd();
           }
           struct.setEventsIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       default:
         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   struct.validate();
 }