/** * Autogenerated by Thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ 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 java.util.Collections; import java.util.BitSet; import java.util.Arrays; import com.facebook.thrift.*; import com.facebook.thrift.annotations.*; import com.facebook.thrift.async.*; import com.facebook.thrift.meta_data.*; import com.facebook.thrift.server.*; import com.facebook.thrift.transport.*; import com.facebook.thrift.protocol.*; @SuppressWarnings({ "unused", "serial" }) public class MyStructMapFloatThrowExp implements TBase, java.io.Serializable, Cloneable, Comparable { private static final TStruct STRUCT_DESC = new TStruct("MyStructMapFloatThrowExp"); private static final TField MY_LONG_FIELD_FIELD_DESC = new TField("myLongField", TType.I64, (short)1); private static final TField MAP_LIST_OF_FLOATS_FIELD_DESC = new TField("mapListOfFloats", TType.MAP, (short)2); public long myLongField; public Map>> mapListOfFloats; public static final int MYLONGFIELD = 1; public static final int MAPLISTOFFLOATS = 2; // isset id assignments private static final int __MYLONGFIELD_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); public static final Map metaDataMap; static { Map tmpMetaDataMap = new HashMap(); tmpMetaDataMap.put(MYLONGFIELD, new FieldMetaData("myLongField", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I64))); tmpMetaDataMap.put(MAPLISTOFFLOATS, new FieldMetaData("mapListOfFloats", TFieldRequirementType.DEFAULT, new MapMetaData(TType.MAP, new FieldValueMetaData(TType.I32), new ListMetaData(TType.LIST, new ListMetaData(TType.LIST, new FieldValueMetaData(TType.FLOAT)))))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } static { FieldMetaData.addStructMetaDataMap(MyStructMapFloatThrowExp.class, metaDataMap); } public MyStructMapFloatThrowExp() { } public MyStructMapFloatThrowExp( long myLongField, Map>> mapListOfFloats) { this(); this.myLongField = myLongField; setMyLongFieldIsSet(true); this.mapListOfFloats = mapListOfFloats; } public static class Builder { private long myLongField; private Map>> mapListOfFloats; BitSet __optional_isset = new BitSet(1); public Builder() { } public Builder setMyLongField(final long myLongField) { this.myLongField = myLongField; __optional_isset.set(__MYLONGFIELD_ISSET_ID, true); return this; } public Builder setMapListOfFloats(final Map>> mapListOfFloats) { this.mapListOfFloats = mapListOfFloats; return this; } public MyStructMapFloatThrowExp build() { MyStructMapFloatThrowExp result = new MyStructMapFloatThrowExp(); if (__optional_isset.get(__MYLONGFIELD_ISSET_ID)) { result.setMyLongField(this.myLongField); } result.setMapListOfFloats(this.mapListOfFloats); return result; } } public static Builder builder() { return new Builder(); } /** * Performs a deep copy on other. */ public MyStructMapFloatThrowExp(MyStructMapFloatThrowExp other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); this.myLongField = TBaseHelper.deepCopy(other.myLongField); if (other.isSetMapListOfFloats()) { this.mapListOfFloats = TBaseHelper.deepCopy(other.mapListOfFloats); } } public MyStructMapFloatThrowExp deepCopy() { return new MyStructMapFloatThrowExp(this); } public long getMyLongField() { return this.myLongField; } public MyStructMapFloatThrowExp setMyLongField(long myLongField) { this.myLongField = myLongField; setMyLongFieldIsSet(true); return this; } public void unsetMyLongField() { __isset_bit_vector.clear(__MYLONGFIELD_ISSET_ID); } // Returns true if field myLongField is set (has been assigned a value) and false otherwise public boolean isSetMyLongField() { return __isset_bit_vector.get(__MYLONGFIELD_ISSET_ID); } public void setMyLongFieldIsSet(boolean __value) { __isset_bit_vector.set(__MYLONGFIELD_ISSET_ID, __value); } public Map>> getMapListOfFloats() { return this.mapListOfFloats; } public MyStructMapFloatThrowExp setMapListOfFloats(Map>> mapListOfFloats) { this.mapListOfFloats = mapListOfFloats; return this; } public void unsetMapListOfFloats() { this.mapListOfFloats = null; } // Returns true if field mapListOfFloats is set (has been assigned a value) and false otherwise public boolean isSetMapListOfFloats() { return this.mapListOfFloats != null; } public void setMapListOfFloatsIsSet(boolean __value) { if (!__value) { this.mapListOfFloats = null; } } @SuppressWarnings("unchecked") public void setFieldValue(int fieldID, Object __value) { switch (fieldID) { case MYLONGFIELD: if (__value == null) { unsetMyLongField(); } else { setMyLongField((Long)__value); } break; case MAPLISTOFFLOATS: if (__value == null) { unsetMapListOfFloats(); } else { setMapListOfFloats((Map>>)__value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case MYLONGFIELD: return new Long(getMyLongField()); case MAPLISTOFFLOATS: return getMapListOfFloats(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object _that) { if (_that == null) return false; if (this == _that) return true; if (!(_that instanceof MyStructMapFloatThrowExp)) return false; MyStructMapFloatThrowExp that = (MyStructMapFloatThrowExp)_that; if (!TBaseHelper.equalsNobinary(this.myLongField, that.myLongField)) { return false; } if (!TBaseHelper.equalsNobinary(this.isSetMapListOfFloats(), that.isSetMapListOfFloats(), this.mapListOfFloats, that.mapListOfFloats)) { return false; } return true; } @Override public int hashCode() { return Arrays.deepHashCode(new Object[] {myLongField, mapListOfFloats}); } @Override public int compareTo(MyStructMapFloatThrowExp other) { if (other == null) { // See java.lang.Comparable docs throw new NullPointerException(); } if (other == this) { return 0; } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetMyLongField()).compareTo(other.isSetMyLongField()); if (lastComparison != 0) { return lastComparison; } lastComparison = TBaseHelper.compareTo(myLongField, other.myLongField); if (lastComparison != 0) { return lastComparison; } lastComparison = Boolean.valueOf(isSetMapListOfFloats()).compareTo(other.isSetMapListOfFloats()); if (lastComparison != 0) { return lastComparison; } lastComparison = TBaseHelper.compareTo(mapListOfFloats, other.mapListOfFloats); if (lastComparison != 0) { return lastComparison; } return 0; } public void read(TProtocol iprot) throws TException { TField __field; iprot.readStructBegin(metaDataMap); while (true) { __field = iprot.readFieldBegin(); if (__field.type == TType.STOP) { break; } switch (__field.id) { case MYLONGFIELD: if (__field.type == TType.I64) { this.myLongField = iprot.readI64(); setMyLongFieldIsSet(true); } else { TProtocolUtil.skip(iprot, __field.type); } break; case MAPLISTOFFLOATS: if (__field.type == TType.MAP) { { TMap _map0 = iprot.readMapBegin(); this.mapListOfFloats = new HashMap>>(Math.max(0, 2*_map0.size)); for (int _i1 = 0; (_map0.size < 0) ? iprot.peekMap() : (_i1 < _map0.size); ++_i1) { int _key2; List> _val3; _key2 = iprot.readI32(); { TList _list4 = iprot.readListBegin(); _val3 = new ArrayList>(Math.max(0, _list4.size)); for (int _i5 = 0; (_list4.size < 0) ? iprot.peekList() : (_i5 < _list4.size); ++_i5) { List _elem6; { TList _list7 = iprot.readListBegin(); _elem6 = new ArrayList(Math.max(0, _list7.size)); for (int _i8 = 0; (_list7.size < 0) ? iprot.peekList() : (_i8 < _list7.size); ++_i8) { float _elem9; _elem9 = iprot.readFloat(); _elem6.add(_elem9); } iprot.readListEnd(); } _val3.add(_elem6); } iprot.readListEnd(); } this.mapListOfFloats.put(_key2, _val3); } iprot.readMapEnd(); } } else { TProtocolUtil.skip(iprot, __field.type); } break; default: TProtocolUtil.skip(iprot, __field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(MY_LONG_FIELD_FIELD_DESC); oprot.writeI64(this.myLongField); oprot.writeFieldEnd(); if (this.mapListOfFloats != null) { oprot.writeFieldBegin(MAP_LIST_OF_FLOATS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.I32, TType.LIST, this.mapListOfFloats.size())); for (Map.Entry>> _iter10 : this.mapListOfFloats.entrySet()) { oprot.writeI32(_iter10.getKey()); { oprot.writeListBegin(new TList(TType.LIST, _iter10.getValue().size())); for (List _iter11 : _iter10.getValue()) { { oprot.writeListBegin(new TList(TType.FLOAT, _iter11.size())); for (float _iter12 : _iter11) { oprot.writeFloat(_iter12); } oprot.writeListEnd(); } } oprot.writeListEnd(); } } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { return toString(1, true); } @Override public String toString(int indent, boolean prettyPrint) { String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; String newLine = prettyPrint ? "\n" : ""; String space = prettyPrint ? " " : ""; StringBuilder sb = new StringBuilder("MyStructMapFloatThrowExp"); sb.append(space); sb.append("("); sb.append(newLine); boolean first = true; sb.append(indentStr); sb.append("myLongField"); sb.append(space); sb.append(":").append(space); sb.append(TBaseHelper.toString(this.getMyLongField(), indent + 1, prettyPrint)); first = false; if (!first) sb.append("," + newLine); sb.append(indentStr); sb.append("mapListOfFloats"); sb.append(space); sb.append(":").append(space); if (this.getMapListOfFloats() == null) { sb.append("null"); } else { sb.append(TBaseHelper.toString(this.getMapListOfFloats(), indent + 1, prettyPrint)); } first = false; sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } }