Esempio n. 1
0
 @Override
 protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID)
     throws org.apache.thrift.TException {
   _Fields setField = _Fields.findByThriftId(fieldID);
   if (setField != null) {
     switch (setField) {
       case SERIALIZED_JAVA:
         ByteBuffer serialized_java;
         serialized_java = iprot.readBinary();
         return serialized_java;
       case SHELL:
         ShellComponent shell;
         shell = new ShellComponent();
         shell.read(iprot);
         return shell;
       case JAVA_OBJECT:
         JavaObject java_object;
         java_object = new JavaObject();
         java_object.read(iprot);
         return java_object;
       default:
         throw new IllegalStateException(
             "setField wasn't null, but didn't match any of the case statements!");
     }
   } else {
     throw new TProtocolException("Couldn't find a field with field id " + fieldID);
   }
 }
Esempio n. 2
0
 @Override
 protected Object standardSchemeReadValue(
     org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field)
     throws org.apache.thrift.TException {
   _Fields setField = _Fields.findByThriftId(field.id);
   if (setField != null) {
     switch (setField) {
       case SERIALIZED_JAVA:
         if (field.type == SERIALIZED_JAVA_FIELD_DESC.type) {
           ByteBuffer serialized_java;
           serialized_java = iprot.readBinary();
           return serialized_java;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case SHELL:
         if (field.type == SHELL_FIELD_DESC.type) {
           ShellComponent shell;
           shell = new ShellComponent();
           shell.read(iprot);
           return shell;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case JAVA_OBJECT:
         if (field.type == JAVA_OBJECT_FIELD_DESC.type) {
           JavaObject java_object;
           java_object = new JavaObject();
           java_object.read(iprot);
           return java_object;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       default:
         throw new IllegalStateException(
             "setField wasn't null, but didn't match any of the case statements!");
     }
   } else {
     org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
     return null;
   }
 }
Esempio n. 3
0
 @Override
 protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot)
     throws org.apache.thrift.TException {
   switch (setField_) {
     case SERIALIZED_JAVA:
       ByteBuffer serialized_java = (ByteBuffer) value_;
       oprot.writeBinary(serialized_java);
       return;
     case SHELL:
       ShellComponent shell = (ShellComponent) value_;
       shell.write(oprot);
       return;
     case JAVA_OBJECT:
       JavaObject java_object = (JavaObject) value_;
       java_object.write(oprot);
       return;
     default:
       throw new IllegalStateException("Cannot write union with unknown field " + setField_);
   }
 }