Esempio n. 1
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, Offset struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(6);
   if (incoming.get(0)) {
     struct.type = OffsetType.findByValue(iprot.readI32());
     struct.setTypeIsSet(true);
   }
   if (incoming.get(1)) {
     struct.first = iprot.readI64();
     struct.setFirstIsSet(true);
   }
   if (incoming.get(2)) {
     struct.length = iprot.readI32();
     struct.setLengthIsSet(true);
   }
   if (incoming.get(3)) {
     struct.xpath = iprot.readString();
     struct.setXpathIsSet(true);
   }
   if (incoming.get(4)) {
     struct.content_form = iprot.readString();
     struct.setContent_formIsSet(true);
   }
   if (incoming.get(5)) {
     struct.value = iprot.readBinary();
     struct.setValueIsSet(true);
   }
 }
Esempio n. 2
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, Offset 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: // TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.type = OffsetType.findByValue(iprot.readI32());
              struct.setTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // FIRST
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.first = iprot.readI64();
              struct.setFirstIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // LENGTH
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.length = iprot.readI32();
              struct.setLengthIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // XPATH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.xpath = iprot.readString();
              struct.setXpathIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // CONTENT_FORM
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.content_form = iprot.readString();
              struct.setContent_formIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // VALUE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.value = iprot.readBinary();
              struct.setValueIsSet(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();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }