/**
 * Autogenerated by Thrift Compiler (0.11.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.facebook.buck.log.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)")
public class VersionControlStatsRemoteLogEntry implements org.apache.thrift.TBase<VersionControlStatsRemoteLogEntry, VersionControlStatsRemoteLogEntry._Fields>, java.io.Serializable, Cloneable, Comparable<VersionControlStatsRemoteLogEntry> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("VersionControlStatsRemoteLogEntry");

  private static final org.apache.thrift.protocol.TField CURRENT_REVISION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("currentRevisionId", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField BASE_BOOKMARKS_FIELD_DESC = new org.apache.thrift.protocol.TField("baseBookmarks", org.apache.thrift.protocol.TType.LIST, (short)2);
  private static final org.apache.thrift.protocol.TField PATHS_CHANGED_FIELD_DESC = new org.apache.thrift.protocol.TField("pathsChanged", org.apache.thrift.protocol.TType.LIST, (short)3);
  private static final org.apache.thrift.protocol.TField PATHS_CHANGED_SAMPLED_FIELD_DESC = new org.apache.thrift.protocol.TField("pathsChangedSampled", org.apache.thrift.protocol.TType.BOOL, (short)4);
  private static final org.apache.thrift.protocol.TField UNSAMPLED_PATHS_CHANGED_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("unsampledPathsChangedCount", org.apache.thrift.protocol.TType.I32, (short)5);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new VersionControlStatsRemoteLogEntryStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new VersionControlStatsRemoteLogEntryTupleSchemeFactory();

  public java.lang.String currentRevisionId; // optional
  public java.util.List<java.lang.String> baseBookmarks; // optional
  public java.util.List<java.lang.String> pathsChanged; // optional
  public boolean pathsChangedSampled; // optional
  public int unsampledPathsChangedCount; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    CURRENT_REVISION_ID((short)1, "currentRevisionId"),
    BASE_BOOKMARKS((short)2, "baseBookmarks"),
    PATHS_CHANGED((short)3, "pathsChanged"),
    PATHS_CHANGED_SAMPLED((short)4, "pathsChangedSampled"),
    UNSAMPLED_PATHS_CHANGED_COUNT((short)5, "unsampledPathsChangedCount");

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

    static {
      for (_Fields field : java.util.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: // CURRENT_REVISION_ID
          return CURRENT_REVISION_ID;
        case 2: // BASE_BOOKMARKS
          return BASE_BOOKMARKS;
        case 3: // PATHS_CHANGED
          return PATHS_CHANGED;
        case 4: // PATHS_CHANGED_SAMPLED
          return PATHS_CHANGED_SAMPLED;
        case 5: // UNSAMPLED_PATHS_CHANGED_COUNT
          return UNSAMPLED_PATHS_CHANGED_COUNT;
        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 java.lang.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(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

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

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __PATHSCHANGEDSAMPLED_ISSET_ID = 0;
  private static final int __UNSAMPLEDPATHSCHANGEDCOUNT_ISSET_ID = 1;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.CURRENT_REVISION_ID,_Fields.BASE_BOOKMARKS,_Fields.PATHS_CHANGED,_Fields.PATHS_CHANGED_SAMPLED,_Fields.UNSAMPLED_PATHS_CHANGED_COUNT};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.CURRENT_REVISION_ID, new org.apache.thrift.meta_data.FieldMetaData("currentRevisionId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.BASE_BOOKMARKS, new org.apache.thrift.meta_data.FieldMetaData("baseBookmarks", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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.STRING))));
    tmpMap.put(_Fields.PATHS_CHANGED, new org.apache.thrift.meta_data.FieldMetaData("pathsChanged", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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.STRING))));
    tmpMap.put(_Fields.PATHS_CHANGED_SAMPLED, new org.apache.thrift.meta_data.FieldMetaData("pathsChangedSampled", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.UNSAMPLED_PATHS_CHANGED_COUNT, new org.apache.thrift.meta_data.FieldMetaData("unsampledPathsChangedCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(VersionControlStatsRemoteLogEntry.class, metaDataMap);
  }

  public VersionControlStatsRemoteLogEntry() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public VersionControlStatsRemoteLogEntry(VersionControlStatsRemoteLogEntry other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetCurrentRevisionId()) {
      this.currentRevisionId = other.currentRevisionId;
    }
    if (other.isSetBaseBookmarks()) {
      java.util.List<java.lang.String> __this__baseBookmarks = new java.util.ArrayList<java.lang.String>(other.baseBookmarks);
      this.baseBookmarks = __this__baseBookmarks;
    }
    if (other.isSetPathsChanged()) {
      java.util.List<java.lang.String> __this__pathsChanged = new java.util.ArrayList<java.lang.String>(other.pathsChanged);
      this.pathsChanged = __this__pathsChanged;
    }
    this.pathsChangedSampled = other.pathsChangedSampled;
    this.unsampledPathsChangedCount = other.unsampledPathsChangedCount;
  }

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

  @Override
  public void clear() {
    this.currentRevisionId = null;
    this.baseBookmarks = null;
    this.pathsChanged = null;
    setPathsChangedSampledIsSet(false);
    this.pathsChangedSampled = false;
    setUnsampledPathsChangedCountIsSet(false);
    this.unsampledPathsChangedCount = 0;
  }

  public java.lang.String getCurrentRevisionId() {
    return this.currentRevisionId;
  }

  public VersionControlStatsRemoteLogEntry setCurrentRevisionId(java.lang.String currentRevisionId) {
    this.currentRevisionId = currentRevisionId;
    return this;
  }

  public void unsetCurrentRevisionId() {
    this.currentRevisionId = null;
  }

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

  public void setCurrentRevisionIdIsSet(boolean value) {
    if (!value) {
      this.currentRevisionId = null;
    }
  }

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

  public java.util.Iterator<java.lang.String> getBaseBookmarksIterator() {
    return (this.baseBookmarks == null) ? null : this.baseBookmarks.iterator();
  }

  public void addToBaseBookmarks(java.lang.String elem) {
    if (this.baseBookmarks == null) {
      this.baseBookmarks = new java.util.ArrayList<java.lang.String>();
    }
    this.baseBookmarks.add(elem);
  }

  public java.util.List<java.lang.String> getBaseBookmarks() {
    return this.baseBookmarks;
  }

  public VersionControlStatsRemoteLogEntry setBaseBookmarks(java.util.List<java.lang.String> baseBookmarks) {
    this.baseBookmarks = baseBookmarks;
    return this;
  }

  public void unsetBaseBookmarks() {
    this.baseBookmarks = null;
  }

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

  public void setBaseBookmarksIsSet(boolean value) {
    if (!value) {
      this.baseBookmarks = null;
    }
  }

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

  public java.util.Iterator<java.lang.String> getPathsChangedIterator() {
    return (this.pathsChanged == null) ? null : this.pathsChanged.iterator();
  }

  public void addToPathsChanged(java.lang.String elem) {
    if (this.pathsChanged == null) {
      this.pathsChanged = new java.util.ArrayList<java.lang.String>();
    }
    this.pathsChanged.add(elem);
  }

  public java.util.List<java.lang.String> getPathsChanged() {
    return this.pathsChanged;
  }

  public VersionControlStatsRemoteLogEntry setPathsChanged(java.util.List<java.lang.String> pathsChanged) {
    this.pathsChanged = pathsChanged;
    return this;
  }

  public void unsetPathsChanged() {
    this.pathsChanged = null;
  }

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

  public void setPathsChangedIsSet(boolean value) {
    if (!value) {
      this.pathsChanged = null;
    }
  }

  public boolean isPathsChangedSampled() {
    return this.pathsChangedSampled;
  }

  public VersionControlStatsRemoteLogEntry setPathsChangedSampled(boolean pathsChangedSampled) {
    this.pathsChangedSampled = pathsChangedSampled;
    setPathsChangedSampledIsSet(true);
    return this;
  }

  public void unsetPathsChangedSampled() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PATHSCHANGEDSAMPLED_ISSET_ID);
  }

  /** Returns true if field pathsChangedSampled is set (has been assigned a value) and false otherwise */
  public boolean isSetPathsChangedSampled() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PATHSCHANGEDSAMPLED_ISSET_ID);
  }

  public void setPathsChangedSampledIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PATHSCHANGEDSAMPLED_ISSET_ID, value);
  }

  public int getUnsampledPathsChangedCount() {
    return this.unsampledPathsChangedCount;
  }

  public VersionControlStatsRemoteLogEntry setUnsampledPathsChangedCount(int unsampledPathsChangedCount) {
    this.unsampledPathsChangedCount = unsampledPathsChangedCount;
    setUnsampledPathsChangedCountIsSet(true);
    return this;
  }

  public void unsetUnsampledPathsChangedCount() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __UNSAMPLEDPATHSCHANGEDCOUNT_ISSET_ID);
  }

  /** Returns true if field unsampledPathsChangedCount is set (has been assigned a value) and false otherwise */
  public boolean isSetUnsampledPathsChangedCount() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __UNSAMPLEDPATHSCHANGEDCOUNT_ISSET_ID);
  }

  public void setUnsampledPathsChangedCountIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __UNSAMPLEDPATHSCHANGEDCOUNT_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, java.lang.Object value) {
    switch (field) {
    case CURRENT_REVISION_ID:
      if (value == null) {
        unsetCurrentRevisionId();
      } else {
        setCurrentRevisionId((java.lang.String)value);
      }
      break;

    case BASE_BOOKMARKS:
      if (value == null) {
        unsetBaseBookmarks();
      } else {
        setBaseBookmarks((java.util.List<java.lang.String>)value);
      }
      break;

    case PATHS_CHANGED:
      if (value == null) {
        unsetPathsChanged();
      } else {
        setPathsChanged((java.util.List<java.lang.String>)value);
      }
      break;

    case PATHS_CHANGED_SAMPLED:
      if (value == null) {
        unsetPathsChangedSampled();
      } else {
        setPathsChangedSampled((java.lang.Boolean)value);
      }
      break;

    case UNSAMPLED_PATHS_CHANGED_COUNT:
      if (value == null) {
        unsetUnsampledPathsChangedCount();
      } else {
        setUnsampledPathsChangedCount((java.lang.Integer)value);
      }
      break;

    }
  }

  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case CURRENT_REVISION_ID:
      return getCurrentRevisionId();

    case BASE_BOOKMARKS:
      return getBaseBookmarks();

    case PATHS_CHANGED:
      return getPathsChanged();

    case PATHS_CHANGED_SAMPLED:
      return isPathsChangedSampled();

    case UNSAMPLED_PATHS_CHANGED_COUNT:
      return getUnsampledPathsChangedCount();

    }
    throw new java.lang.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 java.lang.IllegalArgumentException();
    }

    switch (field) {
    case CURRENT_REVISION_ID:
      return isSetCurrentRevisionId();
    case BASE_BOOKMARKS:
      return isSetBaseBookmarks();
    case PATHS_CHANGED:
      return isSetPathsChanged();
    case PATHS_CHANGED_SAMPLED:
      return isSetPathsChangedSampled();
    case UNSAMPLED_PATHS_CHANGED_COUNT:
      return isSetUnsampledPathsChangedCount();
    }
    throw new java.lang.IllegalStateException();
  }

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

  public boolean equals(VersionControlStatsRemoteLogEntry that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_currentRevisionId = true && this.isSetCurrentRevisionId();
    boolean that_present_currentRevisionId = true && that.isSetCurrentRevisionId();
    if (this_present_currentRevisionId || that_present_currentRevisionId) {
      if (!(this_present_currentRevisionId && that_present_currentRevisionId))
        return false;
      if (!this.currentRevisionId.equals(that.currentRevisionId))
        return false;
    }

    boolean this_present_baseBookmarks = true && this.isSetBaseBookmarks();
    boolean that_present_baseBookmarks = true && that.isSetBaseBookmarks();
    if (this_present_baseBookmarks || that_present_baseBookmarks) {
      if (!(this_present_baseBookmarks && that_present_baseBookmarks))
        return false;
      if (!this.baseBookmarks.equals(that.baseBookmarks))
        return false;
    }

    boolean this_present_pathsChanged = true && this.isSetPathsChanged();
    boolean that_present_pathsChanged = true && that.isSetPathsChanged();
    if (this_present_pathsChanged || that_present_pathsChanged) {
      if (!(this_present_pathsChanged && that_present_pathsChanged))
        return false;
      if (!this.pathsChanged.equals(that.pathsChanged))
        return false;
    }

    boolean this_present_pathsChangedSampled = true && this.isSetPathsChangedSampled();
    boolean that_present_pathsChangedSampled = true && that.isSetPathsChangedSampled();
    if (this_present_pathsChangedSampled || that_present_pathsChangedSampled) {
      if (!(this_present_pathsChangedSampled && that_present_pathsChangedSampled))
        return false;
      if (this.pathsChangedSampled != that.pathsChangedSampled)
        return false;
    }

    boolean this_present_unsampledPathsChangedCount = true && this.isSetUnsampledPathsChangedCount();
    boolean that_present_unsampledPathsChangedCount = true && that.isSetUnsampledPathsChangedCount();
    if (this_present_unsampledPathsChangedCount || that_present_unsampledPathsChangedCount) {
      if (!(this_present_unsampledPathsChangedCount && that_present_unsampledPathsChangedCount))
        return false;
      if (this.unsampledPathsChangedCount != that.unsampledPathsChangedCount)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetCurrentRevisionId()) ? 131071 : 524287);
    if (isSetCurrentRevisionId())
      hashCode = hashCode * 8191 + currentRevisionId.hashCode();

    hashCode = hashCode * 8191 + ((isSetBaseBookmarks()) ? 131071 : 524287);
    if (isSetBaseBookmarks())
      hashCode = hashCode * 8191 + baseBookmarks.hashCode();

    hashCode = hashCode * 8191 + ((isSetPathsChanged()) ? 131071 : 524287);
    if (isSetPathsChanged())
      hashCode = hashCode * 8191 + pathsChanged.hashCode();

    hashCode = hashCode * 8191 + ((isSetPathsChangedSampled()) ? 131071 : 524287);
    if (isSetPathsChangedSampled())
      hashCode = hashCode * 8191 + ((pathsChangedSampled) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetUnsampledPathsChangedCount()) ? 131071 : 524287);
    if (isSetUnsampledPathsChangedCount())
      hashCode = hashCode * 8191 + unsampledPathsChangedCount;

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.valueOf(isSetCurrentRevisionId()).compareTo(other.isSetCurrentRevisionId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCurrentRevisionId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.currentRevisionId, other.currentRevisionId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetBaseBookmarks()).compareTo(other.isSetBaseBookmarks());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBaseBookmarks()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.baseBookmarks, other.baseBookmarks);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetPathsChanged()).compareTo(other.isSetPathsChanged());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPathsChanged()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pathsChanged, other.pathsChanged);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetPathsChangedSampled()).compareTo(other.isSetPathsChangedSampled());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPathsChangedSampled()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pathsChangedSampled, other.pathsChangedSampled);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetUnsampledPathsChangedCount()).compareTo(other.isSetUnsampledPathsChangedCount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUnsampledPathsChangedCount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.unsampledPathsChangedCount, other.unsampledPathsChangedCount);
      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 {
    scheme(iprot).read(iprot, this);
  }

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

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("VersionControlStatsRemoteLogEntry(");
    boolean first = true;

    if (isSetCurrentRevisionId()) {
      sb.append("currentRevisionId:");
      if (this.currentRevisionId == null) {
        sb.append("null");
      } else {
        sb.append(this.currentRevisionId);
      }
      first = false;
    }
    if (isSetBaseBookmarks()) {
      if (!first) sb.append(", ");
      sb.append("baseBookmarks:");
      if (this.baseBookmarks == null) {
        sb.append("null");
      } else {
        sb.append(this.baseBookmarks);
      }
      first = false;
    }
    if (isSetPathsChanged()) {
      if (!first) sb.append(", ");
      sb.append("pathsChanged:");
      if (this.pathsChanged == null) {
        sb.append("null");
      } else {
        sb.append(this.pathsChanged);
      }
      first = false;
    }
    if (isSetPathsChangedSampled()) {
      if (!first) sb.append(", ");
      sb.append("pathsChangedSampled:");
      sb.append(this.pathsChangedSampled);
      first = false;
    }
    if (isSetUnsampledPathsChangedCount()) {
      if (!first) sb.append(", ");
      sb.append("unsampledPathsChangedCount:");
      sb.append(this.unsampledPathsChangedCount);
      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, java.lang.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 VersionControlStatsRemoteLogEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public VersionControlStatsRemoteLogEntryStandardScheme getScheme() {
      return new VersionControlStatsRemoteLogEntryStandardScheme();
    }
  }

  private static class VersionControlStatsRemoteLogEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme<VersionControlStatsRemoteLogEntry> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, VersionControlStatsRemoteLogEntry 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: // CURRENT_REVISION_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.currentRevisionId = iprot.readString();
              struct.setCurrentRevisionIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // BASE_BOOKMARKS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                struct.baseBookmarks = new java.util.ArrayList<java.lang.String>(_list0.size);
                java.lang.String _elem1;
                for (int _i2 = 0; _i2 < _list0.size; ++_i2)
                {
                  _elem1 = iprot.readString();
                  struct.baseBookmarks.add(_elem1);
                }
                iprot.readListEnd();
              }
              struct.setBaseBookmarksIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // PATHS_CHANGED
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();
                struct.pathsChanged = new java.util.ArrayList<java.lang.String>(_list3.size);
                java.lang.String _elem4;
                for (int _i5 = 0; _i5 < _list3.size; ++_i5)
                {
                  _elem4 = iprot.readString();
                  struct.pathsChanged.add(_elem4);
                }
                iprot.readListEnd();
              }
              struct.setPathsChangedIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // PATHS_CHANGED_SAMPLED
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.pathsChangedSampled = iprot.readBool();
              struct.setPathsChangedSampledIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // UNSAMPLED_PATHS_CHANGED_COUNT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.unsampledPathsChangedCount = iprot.readI32();
              struct.setUnsampledPathsChangedCountIsSet(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, VersionControlStatsRemoteLogEntry struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.currentRevisionId != null) {
        if (struct.isSetCurrentRevisionId()) {
          oprot.writeFieldBegin(CURRENT_REVISION_ID_FIELD_DESC);
          oprot.writeString(struct.currentRevisionId);
          oprot.writeFieldEnd();
        }
      }
      if (struct.baseBookmarks != null) {
        if (struct.isSetBaseBookmarks()) {
          oprot.writeFieldBegin(BASE_BOOKMARKS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.baseBookmarks.size()));
            for (java.lang.String _iter6 : struct.baseBookmarks)
            {
              oprot.writeString(_iter6);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.pathsChanged != null) {
        if (struct.isSetPathsChanged()) {
          oprot.writeFieldBegin(PATHS_CHANGED_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.pathsChanged.size()));
            for (java.lang.String _iter7 : struct.pathsChanged)
            {
              oprot.writeString(_iter7);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetPathsChangedSampled()) {
        oprot.writeFieldBegin(PATHS_CHANGED_SAMPLED_FIELD_DESC);
        oprot.writeBool(struct.pathsChangedSampled);
        oprot.writeFieldEnd();
      }
      if (struct.isSetUnsampledPathsChangedCount()) {
        oprot.writeFieldBegin(UNSAMPLED_PATHS_CHANGED_COUNT_FIELD_DESC);
        oprot.writeI32(struct.unsampledPathsChangedCount);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class VersionControlStatsRemoteLogEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public VersionControlStatsRemoteLogEntryTupleScheme getScheme() {
      return new VersionControlStatsRemoteLogEntryTupleScheme();
    }
  }

  private static class VersionControlStatsRemoteLogEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme<VersionControlStatsRemoteLogEntry> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, VersionControlStatsRemoteLogEntry struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetCurrentRevisionId()) {
        optionals.set(0);
      }
      if (struct.isSetBaseBookmarks()) {
        optionals.set(1);
      }
      if (struct.isSetPathsChanged()) {
        optionals.set(2);
      }
      if (struct.isSetPathsChangedSampled()) {
        optionals.set(3);
      }
      if (struct.isSetUnsampledPathsChangedCount()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetCurrentRevisionId()) {
        oprot.writeString(struct.currentRevisionId);
      }
      if (struct.isSetBaseBookmarks()) {
        {
          oprot.writeI32(struct.baseBookmarks.size());
          for (java.lang.String _iter8 : struct.baseBookmarks)
          {
            oprot.writeString(_iter8);
          }
        }
      }
      if (struct.isSetPathsChanged()) {
        {
          oprot.writeI32(struct.pathsChanged.size());
          for (java.lang.String _iter9 : struct.pathsChanged)
          {
            oprot.writeString(_iter9);
          }
        }
      }
      if (struct.isSetPathsChangedSampled()) {
        oprot.writeBool(struct.pathsChangedSampled);
      }
      if (struct.isSetUnsampledPathsChangedCount()) {
        oprot.writeI32(struct.unsampledPathsChangedCount);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, VersionControlStatsRemoteLogEntry struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.currentRevisionId = iprot.readString();
        struct.setCurrentRevisionIdIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list10 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.baseBookmarks = new java.util.ArrayList<java.lang.String>(_list10.size);
          java.lang.String _elem11;
          for (int _i12 = 0; _i12 < _list10.size; ++_i12)
          {
            _elem11 = iprot.readString();
            struct.baseBookmarks.add(_elem11);
          }
        }
        struct.setBaseBookmarksIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.pathsChanged = new java.util.ArrayList<java.lang.String>(_list13.size);
          java.lang.String _elem14;
          for (int _i15 = 0; _i15 < _list13.size; ++_i15)
          {
            _elem14 = iprot.readString();
            struct.pathsChanged.add(_elem14);
          }
        }
        struct.setPathsChangedIsSet(true);
      }
      if (incoming.get(3)) {
        struct.pathsChangedSampled = iprot.readBool();
        struct.setPathsChangedSampledIsSet(true);
      }
      if (incoming.get(4)) {
        struct.unsampledPathsChangedCount = iprot.readI32();
        struct.setUnsampledPathsChangedCountIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}

