/*******************************************************************************
 * Copyright (c) 2015, 2016 CNRS, IRIT, IRT AESE (IRT Saint Exupéry).
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the LGPL 3.0
 * which accompanies this distribution, and is available at
 * https://www.gnu.org/licenses/lgpl-3.0-standalone.html
 *
 * Contributors:
 *      Faiez Zalila - initial API and implementation and/or initial documentation
 *******************************************************************************/
/**
 * Autogenerated by Thrift Compiler (0.9.2)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package tts;

import java.util.ArrayList;
import java.util.BitSet;
import java.util.Collections;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Generated;

import org.apache.thrift.EncodingUtils;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-2-8")
public class TTSState implements org.apache.thrift.TBase<TTSState, TTSState._Fields>, java.io.Serializable, Cloneable, Comparable<TTSState> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTSState");

  private static final org.apache.thrift.protocol.TField UID_FIELD_DESC = new org.apache.thrift.protocol.TField("uid", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField MARKINGS_FIELD_DESC = new org.apache.thrift.protocol.TField("markings", org.apache.thrift.protocol.TType.LIST, (short)2);
  private static final org.apache.thrift.protocol.TField CLOCKS_FIELD_DESC = new org.apache.thrift.protocol.TField("clocks", org.apache.thrift.protocol.TType.MAP, (short)3);
  private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.STRING, (short)4);

  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new TTSStateStandardSchemeFactory());
    schemes.put(TupleScheme.class, new TTSStateTupleSchemeFactory());
  }

  public long uid; // required
  public List<Long> markings; // required
  public Map<Long,Clock> clocks; // required
  public String values; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    UID((short)1, "uid"),
    MARKINGS((short)2, "markings"),
    CLOCKS((short)3, "clocks"),
    VALUES((short)4, "values");

    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // UID
          return UID;
        case 2: // MARKINGS
          return MARKINGS;
        case 3: // CLOCKS
          return CLOCKS;
        case 4: // VALUES
          return VALUES;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __UID_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.UID, new org.apache.thrift.meta_data.FieldMetaData("uid", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "state_id")));
    tmpMap.put(_Fields.MARKINGS, new org.apache.thrift.meta_data.FieldMetaData("markings", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64            , "place_id"))));
    tmpMap.put(_Fields.CLOCKS, new org.apache.thrift.meta_data.FieldMetaData("clocks", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64            , "transition_id"), 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Clock.class))));
    tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , "json")));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTSState.class, metaDataMap);
  }

  public TTSState() {
  }

  public TTSState(
    long uid,
    List<Long> markings,
    Map<Long,Clock> clocks,
    String values)
  {
    this();
    this.uid = uid;
    setUidIsSet(true);
    this.markings = markings;
    this.clocks = clocks;
    this.values = values;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TTSState(TTSState other) {
    __isset_bitfield = other.__isset_bitfield;
    this.uid = other.uid;
    if (other.isSetMarkings()) {
      List<Long> __this__markings = new ArrayList<Long>(other.markings.size());
      for (Long other_element : other.markings) {
        __this__markings.add(other_element);
      }
      this.markings = __this__markings;
    }
    if (other.isSetClocks()) {
      Map<Long,Clock> __this__clocks = new HashMap<Long,Clock>(other.clocks.size());
      for (Map.Entry<Long, Clock> other_element : other.clocks.entrySet()) {

        Long other_element_key = other_element.getKey();
        Clock other_element_value = other_element.getValue();

        Long __this__clocks_copy_key = other_element_key;

        Clock __this__clocks_copy_value = new Clock(other_element_value);

        __this__clocks.put(__this__clocks_copy_key, __this__clocks_copy_value);
      }
      this.clocks = __this__clocks;
    }
    if (other.isSetValues()) {
      this.values = other.values;
    }
  }

  public TTSState deepCopy() {
    return new TTSState(this);
  }

  @Override
  public void clear() {
    setUidIsSet(false);
    this.uid = 0;
    this.markings = null;
    this.clocks = null;
    this.values = null;
  }

  public long getUid() {
    return this.uid;
  }

  public TTSState setUid(long uid) {
    this.uid = uid;
    setUidIsSet(true);
    return this;
  }

  public void unsetUid() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UID_ISSET_ID);
  }

  /** Returns true if field uid is set (has been assigned a value) and false otherwise */
  public boolean isSetUid() {
    return EncodingUtils.testBit(__isset_bitfield, __UID_ISSET_ID);
  }

  public void setUidIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID_ISSET_ID, value);
  }

  public int getMarkingsSize() {
    return (this.markings == null) ? 0 : this.markings.size();
  }

  public java.util.Iterator<Long> getMarkingsIterator() {
    return (this.markings == null) ? null : this.markings.iterator();
  }

  public void addToMarkings(long elem) {
    if (this.markings == null) {
      this.markings = new ArrayList<Long>();
    }
    this.markings.add(elem);
  }

  public List<Long> getMarkings() {
    return this.markings;
  }

  public TTSState setMarkings(List<Long> markings) {
    this.markings = markings;
    return this;
  }

  public void unsetMarkings() {
    this.markings = null;
  }

  /** Returns true if field markings is set (has been assigned a value) and false otherwise */
  public boolean isSetMarkings() {
    return this.markings != null;
  }

  public void setMarkingsIsSet(boolean value) {
    if (!value) {
      this.markings = null;
    }
  }

  public int getClocksSize() {
    return (this.clocks == null) ? 0 : this.clocks.size();
  }

  public void putToClocks(long key, Clock val) {
    if (this.clocks == null) {
      this.clocks = new HashMap<Long,Clock>();
    }
    this.clocks.put(key, val);
  }

  public Map<Long,Clock> getClocks() {
    return this.clocks;
  }

  public TTSState setClocks(Map<Long,Clock> clocks) {
    this.clocks = clocks;
    return this;
  }

  public void unsetClocks() {
    this.clocks = null;
  }

  /** Returns true if field clocks is set (has been assigned a value) and false otherwise */
  public boolean isSetClocks() {
    return this.clocks != null;
  }

  public void setClocksIsSet(boolean value) {
    if (!value) {
      this.clocks = null;
    }
  }

  public String getValues() {
    return this.values;
  }

  public TTSState setValues(String values) {
    this.values = values;
    return this;
  }

  public void unsetValues() {
    this.values = null;
  }

  /** Returns true if field values is set (has been assigned a value) and false otherwise */
  public boolean isSetValues() {
    return this.values != null;
  }

  public void setValuesIsSet(boolean value) {
    if (!value) {
      this.values = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case UID:
      if (value == null) {
        unsetUid();
      } else {
        setUid((Long)value);
      }
      break;

    case MARKINGS:
      if (value == null) {
        unsetMarkings();
      } else {
        setMarkings((List<Long>)value);
      }
      break;

    case CLOCKS:
      if (value == null) {
        unsetClocks();
      } else {
        setClocks((Map<Long,Clock>)value);
      }
      break;

    case VALUES:
      if (value == null) {
        unsetValues();
      } else {
        setValues((String)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case UID:
      return Long.valueOf(getUid());

    case MARKINGS:
      return getMarkings();

    case CLOCKS:
      return getClocks();

    case VALUES:
      return getValues();

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case UID:
      return isSetUid();
    case MARKINGS:
      return isSetMarkings();
    case CLOCKS:
      return isSetClocks();
    case VALUES:
      return isSetValues();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof TTSState)
      return this.equals((TTSState)that);
    return false;
  }

  public boolean equals(TTSState that) {
    if (that == null)
      return false;

    boolean this_present_uid = true;
    boolean that_present_uid = true;
    if (this_present_uid || that_present_uid) {
      if (!(this_present_uid && that_present_uid))
        return false;
      if (this.uid != that.uid)
        return false;
    }

    boolean this_present_markings = true && this.isSetMarkings();
    boolean that_present_markings = true && that.isSetMarkings();
    if (this_present_markings || that_present_markings) {
      if (!(this_present_markings && that_present_markings))
        return false;
      if (!this.markings.equals(that.markings))
        return false;
    }

    boolean this_present_clocks = true && this.isSetClocks();
    boolean that_present_clocks = true && that.isSetClocks();
    if (this_present_clocks || that_present_clocks) {
      if (!(this_present_clocks && that_present_clocks))
        return false;
      if (!this.clocks.equals(that.clocks))
        return false;
    }

    boolean this_present_values = true && this.isSetValues();
    boolean that_present_values = true && that.isSetValues();
    if (this_present_values || that_present_values) {
      if (!(this_present_values && that_present_values))
        return false;
      if (!this.values.equals(that.values))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List<Object> list = new ArrayList<Object>();

    boolean present_uid = true;
    list.add(present_uid);
    if (present_uid)
      list.add(uid);

    boolean present_markings = true && (isSetMarkings());
    list.add(present_markings);
    if (present_markings)
      list.add(markings);

    boolean present_clocks = true && (isSetClocks());
    list.add(present_clocks);
    if (present_clocks)
      list.add(clocks);

    boolean present_values = true && (isSetValues());
    list.add(present_values);
    if (present_values)
      list.add(values);

    return list.hashCode();
  }

  @Override
  public int compareTo(TTSState other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetUid()).compareTo(other.isSetUid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid, other.uid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMarkings()).compareTo(other.isSetMarkings());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMarkings()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.markings, other.markings);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetClocks()).compareTo(other.isSetClocks());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetClocks()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clocks, other.clocks);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetValues()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("TTSState(");
    boolean first = true;

    sb.append("uid:");
    sb.append(this.uid);
    first = false;
    if (!first) sb.append(", ");
    sb.append("markings:");
    if (this.markings == null) {
      sb.append("null");
    } else {
      sb.append(this.markings);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("clocks:");
    if (this.clocks == null) {
      sb.append("null");
    } else {
      sb.append(this.clocks);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("values:");
    if (this.values == null) {
      sb.append("null");
    } else {
      sb.append(this.values);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class TTSStateStandardSchemeFactory implements SchemeFactory {
    public TTSStateStandardScheme getScheme() {
      return new TTSStateStandardScheme();
    }
  }

  private static class TTSStateStandardScheme extends StandardScheme<TTSState> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TTSState struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // UID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.uid = iprot.readI64();
              struct.setUidIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // MARKINGS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                struct.markings = new ArrayList<Long>(_list0.size);
                long _elem1;
                for (int _i2 = 0; _i2 < _list0.size; ++_i2)
                {
                  _elem1 = iprot.readI64();
                  struct.markings.add(_elem1);
                }
                iprot.readListEnd();
              }
              struct.setMarkingsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // CLOCKS
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map3 = iprot.readMapBegin();
                struct.clocks = new HashMap<Long,Clock>(2*_map3.size);
                long _key4;
                Clock _val5;
                for (int _i6 = 0; _i6 < _map3.size; ++_i6)
                {
                  _key4 = iprot.readI64();
                  _val5 = new Clock();
                  _val5.read(iprot);
                  struct.clocks.put(_key4, _val5);
                }
                iprot.readMapEnd();
              }
              struct.setClocksIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // VALUES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.values = iprot.readString();
              struct.setValuesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, TTSState struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(UID_FIELD_DESC);
      oprot.writeI64(struct.uid);
      oprot.writeFieldEnd();
      if (struct.markings != null) {
        oprot.writeFieldBegin(MARKINGS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.markings.size()));
          for (long _iter7 : struct.markings)
          {
            oprot.writeI64(_iter7);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.clocks != null) {
        oprot.writeFieldBegin(CLOCKS_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRUCT, struct.clocks.size()));
          for (Map.Entry<Long, Clock> _iter8 : struct.clocks.entrySet())
          {
            oprot.writeI64(_iter8.getKey());
            _iter8.getValue().write(oprot);
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.values != null) {
        oprot.writeFieldBegin(VALUES_FIELD_DESC);
        oprot.writeString(struct.values);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TTSStateTupleSchemeFactory implements SchemeFactory {
    public TTSStateTupleScheme getScheme() {
      return new TTSStateTupleScheme();
    }
  }

  private static class TTSStateTupleScheme extends TupleScheme<TTSState> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TTSState struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetUid()) {
        optionals.set(0);
      }
      if (struct.isSetMarkings()) {
        optionals.set(1);
      }
      if (struct.isSetClocks()) {
        optionals.set(2);
      }
      if (struct.isSetValues()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetUid()) {
        oprot.writeI64(struct.uid);
      }
      if (struct.isSetMarkings()) {
        {
          oprot.writeI32(struct.markings.size());
          for (long _iter9 : struct.markings)
          {
            oprot.writeI64(_iter9);
          }
        }
      }
      if (struct.isSetClocks()) {
        {
          oprot.writeI32(struct.clocks.size());
          for (Map.Entry<Long, Clock> _iter10 : struct.clocks.entrySet())
          {
            oprot.writeI64(_iter10.getKey());
            _iter10.getValue().write(oprot);
          }
        }
      }
      if (struct.isSetValues()) {
        oprot.writeString(struct.values);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TTSState struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.uid = iprot.readI64();
        struct.setUidIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list11 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32());
          struct.markings = new ArrayList<Long>(_list11.size);
          long _elem12;
          for (int _i13 = 0; _i13 < _list11.size; ++_i13)
          {
            _elem12 = iprot.readI64();
            struct.markings.add(_elem12);
          }
        }
        struct.setMarkingsIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TMap _map14 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.clocks = new HashMap<Long,Clock>(2*_map14.size);
          long _key15;
          Clock _val16;
          for (int _i17 = 0; _i17 < _map14.size; ++_i17)
          {
            _key15 = iprot.readI64();
            _val16 = new Clock();
            _val16.read(iprot);
            struct.clocks.put(_key15, _val16);
          }
        }
        struct.setClocksIsSet(true);
      }
      if (incoming.get(3)) {
        struct.values = iprot.readString();
        struct.setValuesIsSet(true);
      }
    }
  }

}

