| /** |
| * Autogenerated by Thrift |
| * |
| * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| */ |
| package com.facebook.thrift.reflection.limited; |
| |
| import java.util.ArrayList; |
| import java.util.AbstractMap; |
| import java.util.HashMap; |
| import java.util.HashSet; |
| import com.facebook.thrift.*; |
| |
| import com.facebook.thrift.protocol.*; |
| import com.facebook.thrift.transport.*; |
| |
| public class ThriftType implements java.io.Serializable { |
| public boolean is_container; |
| public SimpleType simple_type; |
| public ContainerType container_type; |
| |
| public final Isset __isset = new Isset(); |
| public static final class Isset { |
| public boolean is_container = false; |
| public boolean simple_type = false; |
| public boolean container_type = false; |
| } |
| |
| public ThriftType() { |
| } |
| |
| public ThriftType( |
| boolean is_container, |
| SimpleType simple_type, |
| ContainerType container_type) |
| { |
| this(); |
| this.is_container = is_container; |
| this.__isset.is_container = true; |
| this.simple_type = simple_type; |
| this.__isset.simple_type = true; |
| this.container_type = container_type; |
| this.__isset.container_type = true; |
| } |
| |
| 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.BOOL) { |
| this.is_container = iprot.readBool(); |
| this.__isset.is_container = true; |
| } else { |
| TProtocolUtil.skip(iprot, field.type); |
| } |
| break; |
| case 2: |
| if (field.type == TType.STRUCT) { |
| this.simple_type = new SimpleType(); |
| this.simple_type.read(iprot); |
| this.__isset.simple_type = true; |
| } else { |
| TProtocolUtil.skip(iprot, field.type); |
| } |
| break; |
| case 3: |
| if (field.type == TType.STRUCT) { |
| this.container_type = new ContainerType(); |
| this.container_type.read(iprot); |
| this.__isset.container_type = true; |
| } else { |
| TProtocolUtil.skip(iprot, field.type); |
| } |
| break; |
| default: |
| TProtocolUtil.skip(iprot, field.type); |
| break; |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| } |
| |
| public void write(TProtocol oprot) throws TException { |
| TStruct struct = new TStruct("ThriftType"); |
| oprot.writeStructBegin(struct); |
| TField field = new TField(); |
| field.name = "is_container"; |
| field.type = TType.BOOL; |
| field.id = 1; |
| oprot.writeFieldBegin(field); |
| oprot.writeBool(this.is_container); |
| oprot.writeFieldEnd(); |
| if (this.simple_type != null) { |
| field.name = "simple_type"; |
| field.type = TType.STRUCT; |
| field.id = 2; |
| oprot.writeFieldBegin(field); |
| this.simple_type.write(oprot); |
| oprot.writeFieldEnd(); |
| } |
| if (this.container_type != null) { |
| field.name = "container_type"; |
| field.type = TType.STRUCT; |
| field.id = 3; |
| oprot.writeFieldBegin(field); |
| this.container_type.write(oprot); |
| oprot.writeFieldEnd(); |
| } |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| public String toString() { |
| StringBuilder sb = new StringBuilder("ThriftType("); |
| sb.append("is_container:"); |
| sb.append(this.is_container); |
| sb.append(",simple_type:"); |
| sb.append(this.simple_type.toString()); |
| sb.append(",container_type:"); |
| sb.append(this.container_type.toString()); |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| } |
| |