|
@@ -0,0 +1,363 @@
|
|
|
+/**
|
|
|
+ * Licensed to the Apache Software Foundation (ASF) under one
|
|
|
+ * or more contributor license agreements. See the NOTICE file
|
|
|
+ * distributed with this work for additional information
|
|
|
+ * regarding copyright ownership. The ASF licenses this file
|
|
|
+ * to you under the Apache License, Version 2.0 (the
|
|
|
+ * "License"); you may not use this file except in compliance
|
|
|
+ * with the License. You may obtain a copy of the License at
|
|
|
+ *
|
|
|
+ * http://www.apache.org/licenses/LICENSE-2.0
|
|
|
+ *
|
|
|
+ * Unless required by applicable law or agreed to in writing, software
|
|
|
+ * distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
+ * See the License for the specific language governing permissions and
|
|
|
+ * limitations under the License.
|
|
|
+ */
|
|
|
+
|
|
|
+/**
|
|
|
+ * Autogenerated by Thrift
|
|
|
+ *
|
|
|
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
|
+ */
|
|
|
+package org.apache.hadoop.hive.serde2.thrift_test;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Set;
|
|
|
+import java.util.HashSet;
|
|
|
+import com.facebook.thrift.*;
|
|
|
+
|
|
|
+import com.facebook.thrift.protocol.*;
|
|
|
+import com.facebook.thrift.transport.*;
|
|
|
+
|
|
|
+public class Complex implements TBase, java.io.Serializable {
|
|
|
+ public int aint;
|
|
|
+ public String astring;
|
|
|
+ public List<Integer> lint;
|
|
|
+ public List<String> lstring;
|
|
|
+ public List<IntString> lintstring;
|
|
|
+ public Map<String,String> mstringstring;
|
|
|
+
|
|
|
+ public final Isset __isset = new Isset();
|
|
|
+ public static final class Isset implements java.io.Serializable {
|
|
|
+ public boolean aint = false;
|
|
|
+ public boolean astring = false;
|
|
|
+ public boolean lint = false;
|
|
|
+ public boolean lstring = false;
|
|
|
+ public boolean lintstring = false;
|
|
|
+ public boolean mstringstring = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Complex() {
|
|
|
+ }
|
|
|
+
|
|
|
+ public Complex(
|
|
|
+ int aint,
|
|
|
+ String astring,
|
|
|
+ List<Integer> lint,
|
|
|
+ List<String> lstring,
|
|
|
+ List<IntString> lintstring,
|
|
|
+ Map<String,String> mstringstring)
|
|
|
+ {
|
|
|
+ this();
|
|
|
+ this.aint = aint;
|
|
|
+ this.__isset.aint = true;
|
|
|
+ this.astring = astring;
|
|
|
+ this.__isset.astring = true;
|
|
|
+ this.lint = lint;
|
|
|
+ this.__isset.lint = true;
|
|
|
+ this.lstring = lstring;
|
|
|
+ this.__isset.lstring = true;
|
|
|
+ this.lintstring = lintstring;
|
|
|
+ this.__isset.lintstring = true;
|
|
|
+ this.mstringstring = mstringstring;
|
|
|
+ this.__isset.mstringstring = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean equals(Object that) {
|
|
|
+ if (that == null)
|
|
|
+ return false;
|
|
|
+ if (that instanceof Complex)
|
|
|
+ return this.equals((Complex)that);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean equals(Complex that) {
|
|
|
+ if (that == null)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ boolean this_present_aint = true;
|
|
|
+ boolean that_present_aint = true;
|
|
|
+ if (this_present_aint || that_present_aint) {
|
|
|
+ if (!(this_present_aint && that_present_aint))
|
|
|
+ return false;
|
|
|
+ if (this.aint != that.aint)
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ boolean this_present_astring = true && (this.astring != null);
|
|
|
+ boolean that_present_astring = true && (that.astring != null);
|
|
|
+ if (this_present_astring || that_present_astring) {
|
|
|
+ if (!(this_present_astring && that_present_astring))
|
|
|
+ return false;
|
|
|
+ if (!this.astring.equals(that.astring))
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ boolean this_present_lint = true && (this.lint != null);
|
|
|
+ boolean that_present_lint = true && (that.lint != null);
|
|
|
+ if (this_present_lint || that_present_lint) {
|
|
|
+ if (!(this_present_lint && that_present_lint))
|
|
|
+ return false;
|
|
|
+ if (!this.lint.equals(that.lint))
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ boolean this_present_lstring = true && (this.lstring != null);
|
|
|
+ boolean that_present_lstring = true && (that.lstring != null);
|
|
|
+ if (this_present_lstring || that_present_lstring) {
|
|
|
+ if (!(this_present_lstring && that_present_lstring))
|
|
|
+ return false;
|
|
|
+ if (!this.lstring.equals(that.lstring))
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ boolean this_present_lintstring = true && (this.lintstring != null);
|
|
|
+ boolean that_present_lintstring = true && (that.lintstring != null);
|
|
|
+ if (this_present_lintstring || that_present_lintstring) {
|
|
|
+ if (!(this_present_lintstring && that_present_lintstring))
|
|
|
+ return false;
|
|
|
+ if (!this.lintstring.equals(that.lintstring))
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ boolean this_present_mstringstring = true && (this.mstringstring != null);
|
|
|
+ boolean that_present_mstringstring = true && (that.mstringstring != null);
|
|
|
+ if (this_present_mstringstring || that_present_mstringstring) {
|
|
|
+ if (!(this_present_mstringstring && that_present_mstringstring))
|
|
|
+ return false;
|
|
|
+ if (!this.mstringstring.equals(that.mstringstring))
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int hashCode() {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ 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.I32) {
|
|
|
+ this.aint = iprot.readI32();
|
|
|
+ this.__isset.aint = true;
|
|
|
+ } else {
|
|
|
+ TProtocolUtil.skip(iprot, field.type);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ if (field.type == TType.STRING) {
|
|
|
+ this.astring = iprot.readString();
|
|
|
+ this.__isset.astring = true;
|
|
|
+ } else {
|
|
|
+ TProtocolUtil.skip(iprot, field.type);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ if (field.type == TType.LIST) {
|
|
|
+ {
|
|
|
+ TList _list0 = iprot.readListBegin();
|
|
|
+ this.lint = new ArrayList<Integer>(_list0.size);
|
|
|
+ for (int _i1 = 0; _i1 < _list0.size; ++_i1)
|
|
|
+ {
|
|
|
+ int _elem2 = 0;
|
|
|
+ _elem2 = iprot.readI32();
|
|
|
+ this.lint.add(_elem2);
|
|
|
+ }
|
|
|
+ iprot.readListEnd();
|
|
|
+ }
|
|
|
+ this.__isset.lint = true;
|
|
|
+ } else {
|
|
|
+ TProtocolUtil.skip(iprot, field.type);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ if (field.type == TType.LIST) {
|
|
|
+ {
|
|
|
+ TList _list3 = iprot.readListBegin();
|
|
|
+ this.lstring = new ArrayList<String>(_list3.size);
|
|
|
+ for (int _i4 = 0; _i4 < _list3.size; ++_i4)
|
|
|
+ {
|
|
|
+ String _elem5 = null;
|
|
|
+ _elem5 = iprot.readString();
|
|
|
+ this.lstring.add(_elem5);
|
|
|
+ }
|
|
|
+ iprot.readListEnd();
|
|
|
+ }
|
|
|
+ this.__isset.lstring = true;
|
|
|
+ } else {
|
|
|
+ TProtocolUtil.skip(iprot, field.type);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ if (field.type == TType.LIST) {
|
|
|
+ {
|
|
|
+ TList _list6 = iprot.readListBegin();
|
|
|
+ this.lintstring = new ArrayList<IntString>(_list6.size);
|
|
|
+ for (int _i7 = 0; _i7 < _list6.size; ++_i7)
|
|
|
+ {
|
|
|
+ IntString _elem8 = new IntString();
|
|
|
+ _elem8 = new IntString();
|
|
|
+ _elem8.read(iprot);
|
|
|
+ this.lintstring.add(_elem8);
|
|
|
+ }
|
|
|
+ iprot.readListEnd();
|
|
|
+ }
|
|
|
+ this.__isset.lintstring = true;
|
|
|
+ } else {
|
|
|
+ TProtocolUtil.skip(iprot, field.type);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ if (field.type == TType.MAP) {
|
|
|
+ {
|
|
|
+ TMap _map9 = iprot.readMapBegin();
|
|
|
+ this.mstringstring = new HashMap<String,String>(2*_map9.size);
|
|
|
+ for (int _i10 = 0; _i10 < _map9.size; ++_i10)
|
|
|
+ {
|
|
|
+ String _key11;
|
|
|
+ String _val12;
|
|
|
+ _key11 = iprot.readString();
|
|
|
+ _val12 = iprot.readString();
|
|
|
+ this.mstringstring.put(_key11, _val12);
|
|
|
+ }
|
|
|
+ iprot.readMapEnd();
|
|
|
+ }
|
|
|
+ this.__isset.mstringstring = 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("Complex");
|
|
|
+ oprot.writeStructBegin(struct);
|
|
|
+ TField field = new TField();
|
|
|
+ field.name = "aint";
|
|
|
+ field.type = TType.I32;
|
|
|
+ field.id = 1;
|
|
|
+ oprot.writeFieldBegin(field);
|
|
|
+ oprot.writeI32(this.aint);
|
|
|
+ oprot.writeFieldEnd();
|
|
|
+ if (this.astring != null) {
|
|
|
+ field.name = "astring";
|
|
|
+ field.type = TType.STRING;
|
|
|
+ field.id = 2;
|
|
|
+ oprot.writeFieldBegin(field);
|
|
|
+ oprot.writeString(this.astring);
|
|
|
+ oprot.writeFieldEnd();
|
|
|
+ }
|
|
|
+ if (this.lint != null) {
|
|
|
+ field.name = "lint";
|
|
|
+ field.type = TType.LIST;
|
|
|
+ field.id = 3;
|
|
|
+ oprot.writeFieldBegin(field);
|
|
|
+ {
|
|
|
+ oprot.writeListBegin(new TList(TType.I32, this.lint.size()));
|
|
|
+ for (int _iter13 : this.lint) {
|
|
|
+ oprot.writeI32(_iter13);
|
|
|
+ }
|
|
|
+ oprot.writeListEnd();
|
|
|
+ }
|
|
|
+ oprot.writeFieldEnd();
|
|
|
+ }
|
|
|
+ if (this.lstring != null) {
|
|
|
+ field.name = "lstring";
|
|
|
+ field.type = TType.LIST;
|
|
|
+ field.id = 4;
|
|
|
+ oprot.writeFieldBegin(field);
|
|
|
+ {
|
|
|
+ oprot.writeListBegin(new TList(TType.STRING, this.lstring.size()));
|
|
|
+ for (String _iter14 : this.lstring) {
|
|
|
+ oprot.writeString(_iter14);
|
|
|
+ }
|
|
|
+ oprot.writeListEnd();
|
|
|
+ }
|
|
|
+ oprot.writeFieldEnd();
|
|
|
+ }
|
|
|
+ if (this.lintstring != null) {
|
|
|
+ field.name = "lintstring";
|
|
|
+ field.type = TType.LIST;
|
|
|
+ field.id = 5;
|
|
|
+ oprot.writeFieldBegin(field);
|
|
|
+ {
|
|
|
+ oprot.writeListBegin(new TList(TType.STRUCT, this.lintstring.size()));
|
|
|
+ for (IntString _iter15 : this.lintstring) {
|
|
|
+ _iter15.write(oprot);
|
|
|
+ }
|
|
|
+ oprot.writeListEnd();
|
|
|
+ }
|
|
|
+ oprot.writeFieldEnd();
|
|
|
+ }
|
|
|
+ if (this.mstringstring != null) {
|
|
|
+ field.name = "mstringstring";
|
|
|
+ field.type = TType.MAP;
|
|
|
+ field.id = 6;
|
|
|
+ oprot.writeFieldBegin(field);
|
|
|
+ {
|
|
|
+ oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.mstringstring.size()));
|
|
|
+ for (String _iter16 : this.mstringstring.keySet()) {
|
|
|
+ oprot.writeString(_iter16);
|
|
|
+ oprot.writeString(this.mstringstring.get(_iter16));
|
|
|
+ }
|
|
|
+ oprot.writeMapEnd();
|
|
|
+ }
|
|
|
+ oprot.writeFieldEnd();
|
|
|
+ }
|
|
|
+ oprot.writeFieldStop();
|
|
|
+ oprot.writeStructEnd();
|
|
|
+ }
|
|
|
+
|
|
|
+ public String toString() {
|
|
|
+ StringBuilder sb = new StringBuilder("Complex(");
|
|
|
+ sb.append("aint:");
|
|
|
+ sb.append(this.aint);
|
|
|
+ sb.append(",astring:");
|
|
|
+ sb.append(this.astring);
|
|
|
+ sb.append(",lint:");
|
|
|
+ sb.append(this.lint);
|
|
|
+ sb.append(",lstring:");
|
|
|
+ sb.append(this.lstring);
|
|
|
+ sb.append(",lintstring:");
|
|
|
+ sb.append(this.lintstring);
|
|
|
+ sb.append(",mstringstring:");
|
|
|
+ sb.append(this.mstringstring);
|
|
|
+ sb.append(")");
|
|
|
+ return sb.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|