Пример #1
0
 public void read(TProtocol iprot) throws TException {
   TField field;
   iprot.readStructBegin();
   while (true) {
     field = iprot.readFieldBegin();
     if (field.type == TType.STOP) {
       break;
     }
     switch (field.id) {
       case BOOLEANFIELD:
         if (field.type == TType.BOOL) {
           this.booleanField = iprot.readBool();
           this.__isset.booleanField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case BYTEFIELD:
         if (field.type == TType.BYTE) {
           this.byteField = iprot.readByte();
           this.__isset.byteField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case SHORTFIELD:
         if (field.type == TType.I16) {
           this.shortField = iprot.readI16();
           this.__isset.shortField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case INTFIELD:
         if (field.type == TType.I32) {
           this.intField = iprot.readI32();
           this.__isset.intField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case LONGFIELD:
         if (field.type == TType.I64) {
           this.longField = iprot.readI64();
           this.__isset.longField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case DOUBLEFIELD:
         if (field.type == TType.DOUBLE) {
           this.doubleField = iprot.readDouble();
           this.__isset.doubleField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case STRINGFIELD:
         if (field.type == TType.STRING) {
           this.stringField = iprot.readString();
           this.__isset.stringField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case BINARYFIELD:
         if (field.type == TType.STRING) {
           this.binaryField = iprot.readBinary();
           this.__isset.binaryField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case LISTOFINTSFIELD:
         if (field.type == TType.LIST) {
           {
             TList _list0 = iprot.readListBegin();
             this.listOfIntsField = new ArrayList<Integer>(_list0.size);
             for (int _i1 = 0; _i1 < _list0.size; ++_i1) {
               int _elem2 = 0;
               _elem2 = iprot.readI32();
               this.listOfIntsField.add(_elem2);
             }
             iprot.readListEnd();
           }
           this.__isset.listOfIntsField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case SETOFINTSFIELD:
         if (field.type == TType.SET) {
           {
             TSet _set3 = iprot.readSetBegin();
             this.setOfIntsField = new HashSet<Integer>(2 * _set3.size);
             for (int _i4 = 0; _i4 < _set3.size; ++_i4) {
               int _elem5;
               _elem5 = iprot.readI32();
               this.setOfIntsField.add(_elem5);
             }
             iprot.readSetEnd();
           }
           this.__isset.setOfIntsField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case MAPOFINTSINTSFIELD:
         if (field.type == TType.MAP) {
           {
             TMap _map6 = iprot.readMapBegin();
             this.mapOfIntsIntsField = new HashMap<Integer, Integer>(2 * _map6.size);
             for (int _i7 = 0; _i7 < _map6.size; ++_i7) {
               int _key8;
               int _val9;
               _key8 = iprot.readI32();
               _val9 = iprot.readI32();
               this.mapOfIntsIntsField.put(_key8, _val9);
             }
             iprot.readMapEnd();
           }
           this.__isset.mapOfIntsIntsField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case STRUCTFIELD:
         if (field.type == TType.STRUCT) {
           this.structField = new TNestedStruct();
           this.structField.read(iprot);
           this.__isset.structField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case NESTEDLISTOFINTSFIELD:
         if (field.type == TType.LIST) {
           {
             TList _list10 = iprot.readListBegin();
             this.nestedListOfIntsField = new ArrayList<List<Integer>>(_list10.size);
             for (int _i11 = 0; _i11 < _list10.size; ++_i11) {
               List<Integer> _elem12 = new ArrayList<Integer>();
               {
                 TList _list13 = iprot.readListBegin();
                 _elem12 = new ArrayList<Integer>(_list13.size);
                 for (int _i14 = 0; _i14 < _list13.size; ++_i14) {
                   int _elem15 = 0;
                   _elem15 = iprot.readI32();
                   _elem12.add(_elem15);
                 }
                 iprot.readListEnd();
               }
               this.nestedListOfIntsField.add(_elem12);
             }
             iprot.readListEnd();
           }
           this.__isset.nestedListOfIntsField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case MAPOFINTSSTRINGSFIELD:
         if (field.type == TType.MAP) {
           {
             TMap _map16 = iprot.readMapBegin();
             this.mapOfIntsStringsField = new HashMap<Integer, String>(2 * _map16.size);
             for (int _i17 = 0; _i17 < _map16.size; ++_i17) {
               int _key18;
               String _val19;
               _key18 = iprot.readI32();
               _val19 = iprot.readString();
               this.mapOfIntsStringsField.put(_key18, _val19);
             }
             iprot.readMapEnd();
           }
           this.__isset.mapOfIntsStringsField = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       default:
         TProtocolUtil.skip(iprot, field.type);
         break;
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
 }
Пример #2
0
 public void read(TProtocol iprot) throws TException {
   TField field;
   iprot.readStructBegin();
   while (true) {
     field = iprot.readFieldBegin();
     if (field.type == TType.STOP) {
       break;
     }
     switch (field.id) {
       case 1:
         if (field.type == TType.STRING) {
           this.name = iprot.readString();
           this.__isset.name = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 2:
         if (field.type == TType.MAP) {
           {
             TMap _map0 = iprot.readMapBegin();
             this.mappings = new HashMap<Long, Map<String, Integer>>(2 * _map0.size);
             for (int _i1 = 0; _i1 < _map0.size; ++_i1) {
               long _key2;
               Map<String, Integer> _val3;
               _key2 = iprot.readI64();
               {
                 TMap _map4 = iprot.readMapBegin();
                 _val3 = new HashMap<String, Integer>(2 * _map4.size);
                 for (int _i5 = 0; _i5 < _map4.size; ++_i5) {
                   String _key6;
                   int _val7;
                   _key6 = iprot.readString();
                   _val7 = iprot.readI32();
                   _val3.put(_key6, _val7);
                 }
                 iprot.readMapEnd();
               }
               this.mappings.put(_key2, _val3);
             }
             iprot.readMapEnd();
           }
           this.__isset.mappings = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 3:
         if (field.type == TType.LIST) {
           {
             TList _list8 = iprot.readListBegin();
             this.intList = new ArrayList<Short>(_list8.size);
             for (int _i9 = 0; _i9 < _list8.size; ++_i9) {
               short _elem10 = 0;
               _elem10 = iprot.readI16();
               this.intList.add(_elem10);
             }
             iprot.readListEnd();
           }
           this.__isset.intList = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 4:
         if (field.type == TType.SET) {
           {
             TSet _set11 = iprot.readSetBegin();
             this.strSet = new HashSet<String>(2 * _set11.size);
             for (int _i12 = 0; _i12 < _set11.size; ++_i12) {
               String _elem13;
               _elem13 = iprot.readString();
               this.strSet.add(_elem13);
             }
             iprot.readSetEnd();
           }
           this.__isset.strSet = true;
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       default:
         TProtocolUtil.skip(iprot, field.type);
         break;
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
 }