[thrift] checking in generated reflection code into java library
Summary: Generated this code using:
/usr/local/share/thrift/if/reflection_limited.thrift
Reviewed By: dreiss
Test Plan: compiled chat_importer (a java FacebookService) against this.
Revert Plan: sure
Database Impact:
Memcache Impact:
Other Notes:
EImportant:
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665275 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/java/src/reflection/limited/Service.java b/lib/java/src/reflection/limited/Service.java
new file mode 100644
index 0000000..f3a9481
--- /dev/null
+++ b/lib/java/src/reflection/limited/Service.java
@@ -0,0 +1,150 @@
+/**
+ * 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 Service implements java.io.Serializable {
+ public String name;
+ public ArrayList<Method> methods;
+ public boolean fully_reflected;
+
+ public final Isset __isset = new Isset();
+ public static final class Isset {
+ public boolean name = false;
+ public boolean methods = false;
+ public boolean fully_reflected = false;
+ }
+
+ public Service() {
+ }
+
+ public Service(
+ String name,
+ ArrayList<Method> methods,
+ boolean fully_reflected)
+ {
+ this();
+ this.name = name;
+ this.__isset.name = true;
+ this.methods = methods;
+ this.__isset.methods = true;
+ this.fully_reflected = fully_reflected;
+ this.__isset.fully_reflected = 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.STRING) {
+ this.name = iprot.readString();
+ this.__isset.name = true;
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2:
+ if (field.type == TType.LIST) {
+ {
+ TList _list4 = iprot.readListBegin();
+ this.methods = new ArrayList<Method>(_list4.size);
+ for (int _i5 = 0; _i5 < _list4.size; ++_i5)
+ {
+ Method _elem6 = new Method();
+ _elem6 = new Method();
+ _elem6.read(iprot);
+ this.methods.add(_elem6);
+ }
+ iprot.readListEnd();
+ }
+ this.__isset.methods = true;
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 3:
+ if (field.type == TType.BOOL) {
+ this.fully_reflected = iprot.readBool();
+ this.__isset.fully_reflected = 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("Service");
+ oprot.writeStructBegin(struct);
+ TField field = new TField();
+ if (this.name != null) {
+ field.name = "name";
+ field.type = TType.STRING;
+ field.id = 1;
+ oprot.writeFieldBegin(field);
+ oprot.writeString(this.name);
+ oprot.writeFieldEnd();
+ }
+ if (this.methods != null) {
+ field.name = "methods";
+ field.type = TType.LIST;
+ field.id = 2;
+ oprot.writeFieldBegin(field);
+ {
+ oprot.writeListBegin(new TList(TType.STRUCT, this.methods.size()));
+ for (Method _iter7 : this.methods) {
+ _iter7.write(oprot);
+ oprot.writeListEnd();
+ }
+ }
+ oprot.writeFieldEnd();
+ }
+ field.name = "fully_reflected";
+ field.type = TType.BOOL;
+ field.id = 3;
+ oprot.writeFieldBegin(field);
+ oprot.writeBool(this.fully_reflected);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder("Service(");
+ sb.append("name:");
+ sb.append(this.name);
+ sb.append(",methods:");
+ sb.append(this.methods);
+ sb.append(",fully_reflected:");
+ sb.append(this.fully_reflected);
+ sb.append(")");
+ return sb.toString();
+ }
+
+}
+