eletuchy | b8f0d49 | 2007-09-19 01:23:19 +0000 | [diff] [blame] | 1 | /** |
| 2 | * Autogenerated by Thrift |
| 3 | * |
| 4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| 5 | */ |
| 6 | package com.facebook.thrift.reflection.limited; |
| 7 | |
| 8 | import java.util.ArrayList; |
| 9 | import java.util.AbstractMap; |
| 10 | import java.util.HashMap; |
| 11 | import java.util.HashSet; |
| 12 | import com.facebook.thrift.*; |
| 13 | |
| 14 | import com.facebook.thrift.protocol.*; |
| 15 | import com.facebook.thrift.transport.*; |
| 16 | |
| 17 | public class Service implements java.io.Serializable { |
| 18 | public String name; |
| 19 | public ArrayList<Method> methods; |
| 20 | public boolean fully_reflected; |
| 21 | |
| 22 | public final Isset __isset = new Isset(); |
| 23 | public static final class Isset { |
| 24 | public boolean name = false; |
| 25 | public boolean methods = false; |
| 26 | public boolean fully_reflected = false; |
| 27 | } |
| 28 | |
| 29 | public Service() { |
| 30 | } |
| 31 | |
| 32 | public Service( |
| 33 | String name, |
| 34 | ArrayList<Method> methods, |
| 35 | boolean fully_reflected) |
| 36 | { |
| 37 | this(); |
| 38 | this.name = name; |
| 39 | this.__isset.name = true; |
| 40 | this.methods = methods; |
| 41 | this.__isset.methods = true; |
| 42 | this.fully_reflected = fully_reflected; |
| 43 | this.__isset.fully_reflected = true; |
| 44 | } |
| 45 | |
| 46 | public void read(TProtocol iprot) throws TException { |
| 47 | TField field; |
| 48 | iprot.readStructBegin(); |
| 49 | while (true) |
| 50 | { |
| 51 | field = iprot.readFieldBegin(); |
| 52 | if (field.type == TType.STOP) { |
| 53 | break; |
| 54 | } |
| 55 | switch (field.id) |
| 56 | { |
| 57 | case 1: |
| 58 | if (field.type == TType.STRING) { |
| 59 | this.name = iprot.readString(); |
| 60 | this.__isset.name = true; |
| 61 | } else { |
| 62 | TProtocolUtil.skip(iprot, field.type); |
| 63 | } |
| 64 | break; |
| 65 | case 2: |
| 66 | if (field.type == TType.LIST) { |
| 67 | { |
| 68 | TList _list4 = iprot.readListBegin(); |
| 69 | this.methods = new ArrayList<Method>(_list4.size); |
| 70 | for (int _i5 = 0; _i5 < _list4.size; ++_i5) |
| 71 | { |
| 72 | Method _elem6 = new Method(); |
| 73 | _elem6 = new Method(); |
| 74 | _elem6.read(iprot); |
| 75 | this.methods.add(_elem6); |
| 76 | } |
| 77 | iprot.readListEnd(); |
| 78 | } |
| 79 | this.__isset.methods = true; |
| 80 | } else { |
| 81 | TProtocolUtil.skip(iprot, field.type); |
| 82 | } |
| 83 | break; |
| 84 | case 3: |
| 85 | if (field.type == TType.BOOL) { |
| 86 | this.fully_reflected = iprot.readBool(); |
| 87 | this.__isset.fully_reflected = true; |
| 88 | } else { |
| 89 | TProtocolUtil.skip(iprot, field.type); |
| 90 | } |
| 91 | break; |
| 92 | default: |
| 93 | TProtocolUtil.skip(iprot, field.type); |
| 94 | break; |
| 95 | } |
| 96 | iprot.readFieldEnd(); |
| 97 | } |
| 98 | iprot.readStructEnd(); |
| 99 | } |
| 100 | |
| 101 | public void write(TProtocol oprot) throws TException { |
| 102 | TStruct struct = new TStruct("Service"); |
| 103 | oprot.writeStructBegin(struct); |
| 104 | TField field = new TField(); |
| 105 | if (this.name != null) { |
| 106 | field.name = "name"; |
| 107 | field.type = TType.STRING; |
| 108 | field.id = 1; |
| 109 | oprot.writeFieldBegin(field); |
| 110 | oprot.writeString(this.name); |
| 111 | oprot.writeFieldEnd(); |
| 112 | } |
| 113 | if (this.methods != null) { |
| 114 | field.name = "methods"; |
| 115 | field.type = TType.LIST; |
| 116 | field.id = 2; |
| 117 | oprot.writeFieldBegin(field); |
| 118 | { |
| 119 | oprot.writeListBegin(new TList(TType.STRUCT, this.methods.size())); |
| 120 | for (Method _iter7 : this.methods) { |
| 121 | _iter7.write(oprot); |
| 122 | oprot.writeListEnd(); |
| 123 | } |
| 124 | } |
| 125 | oprot.writeFieldEnd(); |
| 126 | } |
| 127 | field.name = "fully_reflected"; |
| 128 | field.type = TType.BOOL; |
| 129 | field.id = 3; |
| 130 | oprot.writeFieldBegin(field); |
| 131 | oprot.writeBool(this.fully_reflected); |
| 132 | oprot.writeFieldEnd(); |
| 133 | oprot.writeFieldStop(); |
| 134 | oprot.writeStructEnd(); |
| 135 | } |
| 136 | |
| 137 | public String toString() { |
| 138 | StringBuilder sb = new StringBuilder("Service("); |
| 139 | sb.append("name:"); |
| 140 | sb.append(this.name); |
| 141 | sb.append(",methods:"); |
| 142 | sb.append(this.methods); |
| 143 | sb.append(",fully_reflected:"); |
| 144 | sb.append(this.fully_reflected); |
| 145 | sb.append(")"); |
| 146 | return sb.toString(); |
| 147 | } |
| 148 | |
| 149 | } |
| 150 | |