R66Result.java

/*
 * This file is part of Waarp Project (named also Waarp or GG).
 *
 *  Copyright (c) 2019, Waarp SAS, and individual contributors by the @author
 *  tags. See the COPYRIGHT.txt in the distribution for a full listing of
 * individual contributors.
 *
 *  All Waarp Project is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * Waarp is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along with
 * Waarp . If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * Autogenerated by Thrift Compiler (0.9.0)
 * <p>
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package org.waarp.thrift.r66;

import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TBase;
import org.apache.thrift.TBaseHelper;
import org.apache.thrift.TException;
import org.apache.thrift.TFieldIdEnum;
import org.apache.thrift.TFieldRequirementType;
import org.apache.thrift.meta_data.EnumMetaData;
import org.apache.thrift.meta_data.FieldMetaData;
import org.apache.thrift.meta_data.FieldValueMetaData;
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.protocol.TField;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TProtocolUtil;
import org.apache.thrift.protocol.TStruct;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TType;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.transport.TIOStreamTransport;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.BitSet;
import java.util.Collections;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public class R66Result
    implements TBase<R66Result, R66Result._Fields>, Cloneable {
  private static final String START2 = "start";

  private static final String MODETRANSFER2 = "modetransfer";

  private static final String BLOCKSIZE2 = "blocksize";

  private static final String ORIGINALFILENAME2 = "originalfilename";

  private static final String ISMOVED2 = "ismoved";

  private static final String RETRIEVEMODE2 = "retrievemode";

  private static final String GLOBALLASTSTEP2 = "globallaststep";

  private static final String GLOBALSTEP2 = "globalstep";

  private static final String RESULTINFO2 = "resultinfo";

  private static final String ACTION2 = "action";

  private static final String DESTUID2 = "destuid";

  private static final String FROMUID2 = "fromuid";

  /**
   *
   */
  private static final long serialVersionUID = 2232890139671363595L;

  private static final TStruct STRUCT_DESC = new TStruct("R66Result");

  private static final TField MODE_FIELD_DESC =
      new TField("mode", TType.I32, (short) 1);
  private static final TField FROMUID_FIELD_DESC =
      new TField(FROMUID2, TType.STRING, (short) 2);
  private static final TField DESTUID_FIELD_DESC =
      new TField(DESTUID2, TType.STRING, (short) 3);
  private static final TField FILE_FIELD_DESC =
      new TField("file", TType.STRING, (short) 4);
  private static final TField RULE_FIELD_DESC =
      new TField("rule", TType.STRING, (short) 5);
  private static final TField TID_FIELD_DESC =
      new TField("tid", TType.I64, (short) 20);
  private static final TField ACTION_FIELD_DESC =
      new TField(ACTION2, TType.I32, (short) 21);
  private static final TField CODE_FIELD_DESC =
      new TField("code", TType.I32, (short) 30);
  private static final TField RESULTINFO_FIELD_DESC =
      new TField(RESULTINFO2, TType.STRING, (short) 31);
  private static final TField GLOBALSTEP_FIELD_DESC =
      new TField(GLOBALSTEP2, TType.I32, (short) 32);
  private static final TField GLOBALLASTSTEP_FIELD_DESC =
      new TField(GLOBALLASTSTEP2, TType.I32, (short) 33);
  private static final TField STEP_FIELD_DESC =
      new TField("step", TType.I32, (short) 34);
  private static final TField RANK_FIELD_DESC =
      new TField("rank", TType.I32, (short) 35);
  private static final TField RETRIEVEMODE_FIELD_DESC =
      new TField(RETRIEVEMODE2, TType.BOOL, (short) 36);
  private static final TField ISMOVED_FIELD_DESC =
      new TField(ISMOVED2, TType.BOOL, (short) 37);
  private static final TField ORIGINALFILENAME_FIELD_DESC =
      new TField(ORIGINALFILENAME2, TType.STRING, (short) 38);
  private static final TField BLOCKSIZE_FIELD_DESC =
      new TField(BLOCKSIZE2, TType.I32, (short) 39);
  private static final TField MODETRANSFER_FIELD_DESC =
      new TField(MODETRANSFER2, TType.I32, (short) 40);
  private static final TField START_FIELD_DESC =
      new TField(START2, TType.STRING, (short) 41);
  private static final TField STOP_FIELD_DESC =
      new TField("stop", TType.STRING, (short) 42);

  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes =
      new HashMap<Class<? extends IScheme>, SchemeFactory>();

  static {
    schemes.put(StandardScheme.class, new R66ResultStandardSchemeFactory());
    schemes.put(TupleScheme.class, new R66ResultTupleSchemeFactory());
  }

  private RequestMode mode; // required
  private String fromuid; // optional
  private String destuid; // optional
  private String file; // optional
  private String rule; // optional
  private long tid; // optional
  private Action action; // optional
  private ErrorCode code; // required
  private String resultinfo; // required
  private int globalstep; // optional
  private int globallaststep; // optional
  private int step; // optional
  private int rank; // optional
  private boolean retrievemode; // optional
  private boolean ismoved; // optional
  private String originalfilename; // optional
  private int blocksize; // optional
  private int modetransfer; // optional
  private String start; // optional
  private String stop; // optional

  @Override
  public final R66Result clone() throws CloneNotSupportedException {
    return (R66Result) super.clone();
  }

  /**
   * The set of fields this struct contains, along with convenience methods
   * for
   * finding and manipulating them.
   */
  public enum _Fields implements TFieldIdEnum {
    /**
     * @see RequestMode
     */
    MODE((short) 1, "mode"), FROMUID((short) 2, FROMUID2),
    DESTUID((short) 3, DESTUID2), FILE((short) 4, "file"),
    RULE((short) 5, "rule"), TID((short) 20, "tid"),
    /**
     * @see Action
     */
    ACTION((short) 21, ACTION2),
    /**
     * @see ErrorCode
     */
    CODE((short) 30, "code"), RESULTINFO((short) 31, RESULTINFO2),
    GLOBALSTEP((short) 32, GLOBALSTEP2),
    GLOBALLASTSTEP((short) 33, GLOBALLASTSTEP2), STEP((short) 34, "step"),
    RANK((short) 35, "rank"), RETRIEVEMODE((short) 36, RETRIEVEMODE2),
    ISMOVED((short) 37, ISMOVED2),
    ORIGINALFILENAME((short) 38, ORIGINALFILENAME2),
    BLOCKSIZE((short) 39, BLOCKSIZE2), MODETRANSFER((short) 40, MODETRANSFER2),
    START((short) 41, START2), STOP((short) 42, "stop");

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

    static {
      for (final _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(final int fieldId) {
      switch (fieldId) {
        case 1: // MODE
          return MODE;
        case 2: // FROMUID
          return FROMUID;
        case 3: // DESTUID
          return DESTUID;
        case 4: // FILE
          return FILE;
        case 5: // RULE
          return RULE;
        case 20: // TID
          return TID;
        case 21: // ACTION
          return ACTION;
        case 30: // CODE
          return CODE;
        case 31: // RESULTINFO
          return RESULTINFO;
        case 32: // GLOBALSTEP
          return GLOBALSTEP;
        case 33: // GLOBALLASTSTEP
          return GLOBALLASTSTEP;
        case 34: // STEP
          return STEP;
        case 35: // RANK
          return RANK;
        case 36: // RETRIEVEMODE
          return RETRIEVEMODE;
        case 37: // ISMOVED
          return ISMOVED;
        case 38: // ORIGINALFILENAME
          return ORIGINALFILENAME;
        case 39: // BLOCKSIZE
          return BLOCKSIZE;
        case 40: // MODETRANSFER
          return MODETRANSFER;
        case 41: // START
          return START;
        case 42: // STOP
          return STOP;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if
     * it is not found.
     */
    public static _Fields findByThriftIdOrThrow(final int fieldId) {
      final _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(final String name) {
      return byName.get(name);
    }

    private final short thriftId;
    private final String fieldName;

    _Fields(final short thriftId, final String fieldName) {
      this.thriftId = thriftId;
      this.fieldName = fieldName;
    }

    @Override
    public final short getThriftFieldId() {
      return thriftId;
    }

    @Override
    public final String getFieldName() {
      return fieldName;
    }
  }

  // isset id assignments
  private static final int TID_ISSET_ID = 0;
  private static final int GLOBALSTEP_ISSET_ID = 1;
  private static final int GLOBALLASTSTEP_ISSET_ID = 2;
  private static final int STEP_ISSET_ID = 3;
  private static final int RANK_ISSET_ID = 4;
  private static final int RETRIEVEMODE_ISSET_ID = 5;
  private static final int ISMOVED_ISSET_ID = 6;
  private static final int BLOCKSIZE_ISSET_ID = 7;
  private static final int MODETRANSFER_ISSET_ID = 8;
  private short issetBitfield;
  public static final Map<_Fields, FieldMetaData> metaDataMap;

  static {
    final Map<_Fields, FieldMetaData> tmpMap =
        new EnumMap<_Fields, FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.MODE,
               new FieldMetaData("mode", TFieldRequirementType.REQUIRED,
                                 new EnumMetaData(TType.ENUM,
                                                  RequestMode.class)));
    tmpMap.put(_Fields.FROMUID,
               new FieldMetaData(FROMUID2, TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.STRING)));
    tmpMap.put(_Fields.DESTUID,
               new FieldMetaData(DESTUID2, TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.STRING)));
    tmpMap.put(_Fields.FILE,
               new FieldMetaData("file", TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.STRING)));
    tmpMap.put(_Fields.RULE,
               new FieldMetaData("rule", TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.STRING)));
    tmpMap.put(_Fields.TID,
               new FieldMetaData("tid", TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.I64)));
    tmpMap.put(_Fields.ACTION,
               new FieldMetaData(ACTION2, TFieldRequirementType.OPTIONAL,
                                 new EnumMetaData(TType.ENUM, Action.class)));
    tmpMap.put(_Fields.CODE,
               new FieldMetaData("code", TFieldRequirementType.REQUIRED,
                                 new EnumMetaData(TType.ENUM,
                                                  ErrorCode.class)));
    tmpMap.put(_Fields.RESULTINFO,
               new FieldMetaData(RESULTINFO2, TFieldRequirementType.REQUIRED,
                                 new FieldValueMetaData(TType.STRING)));
    tmpMap.put(_Fields.GLOBALSTEP,
               new FieldMetaData(GLOBALSTEP2, TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.I32)));
    tmpMap.put(_Fields.GLOBALLASTSTEP, new FieldMetaData(GLOBALLASTSTEP2,
                                                         TFieldRequirementType.OPTIONAL,
                                                         new FieldValueMetaData(
                                                             TType.I32)));
    tmpMap.put(_Fields.STEP,
               new FieldMetaData("step", TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.I32)));
    tmpMap.put(_Fields.RANK,
               new FieldMetaData("rank", TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.I32)));
    tmpMap.put(_Fields.RETRIEVEMODE,
               new FieldMetaData(RETRIEVEMODE2, TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.BOOL)));
    tmpMap.put(_Fields.ISMOVED,
               new FieldMetaData(ISMOVED2, TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.BOOL)));
    tmpMap.put(_Fields.ORIGINALFILENAME, new FieldMetaData(ORIGINALFILENAME2,
                                                           TFieldRequirementType.OPTIONAL,
                                                           new FieldValueMetaData(
                                                               TType.STRING)));
    tmpMap.put(_Fields.BLOCKSIZE,
               new FieldMetaData(BLOCKSIZE2, TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.I32)));
    tmpMap.put(_Fields.MODETRANSFER,
               new FieldMetaData(MODETRANSFER2, TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.I32)));
    tmpMap.put(_Fields.START,
               new FieldMetaData(START2, TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.STRING)));
    tmpMap.put(_Fields.STOP,
               new FieldMetaData("stop", TFieldRequirementType.OPTIONAL,
                                 new FieldValueMetaData(TType.STRING)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    FieldMetaData.addStructMetaDataMap(R66Result.class, metaDataMap);
  }

  public R66Result() {
  }

  public R66Result(final RequestMode mode, final ErrorCode code,
                   final String resultinfo) {
    this();
    this.mode = mode;
    this.code = code;
    this.resultinfo = resultinfo;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public R66Result(final R66Result other) {
    issetBitfield = other.issetBitfield;
    if (other.isSetMode()) {
      mode = other.mode;
    }
    if (other.isSetFromuid()) {
      fromuid = other.fromuid;
    }
    if (other.isSetDestuid()) {
      destuid = other.destuid;
    }
    if (other.isSetFile()) {
      file = other.file;
    }
    if (other.isSetRule()) {
      rule = other.rule;
    }
    tid = other.tid;
    if (other.isSetAction()) {
      action = other.action;
    }
    if (other.isSetCode()) {
      code = other.code;
    }
    if (other.isSetResultinfo()) {
      resultinfo = other.resultinfo;
    }
    globalstep = other.globalstep;
    globallaststep = other.globallaststep;
    step = other.step;
    rank = other.rank;
    retrievemode = other.retrievemode;
    ismoved = other.ismoved;
    if (other.isSetOriginalfilename()) {
      originalfilename = other.originalfilename;
    }
    blocksize = other.blocksize;
    modetransfer = other.modetransfer;
    if (other.isSetStart()) {
      start = other.start;
    }
    if (other.isSetStop()) {
      stop = other.stop;
    }
  }

  @Override
  public final R66Result deepCopy() {
    return new R66Result(this);
  }

  @Override
  public final void clear() {
    mode = null;
    fromuid = null;
    destuid = null;
    file = null;
    rule = null;
    setTidIsSet(false);
    tid = 0;
    action = null;
    code = null;
    resultinfo = null;
    setGlobalstepIsSet(false);
    globalstep = 0;
    setGloballaststepIsSet(false);
    globallaststep = 0;
    setStepIsSet(false);
    step = 0;
    setRankIsSet(false);
    rank = 0;
    setRetrievemodeIsSet(false);
    retrievemode = false;
    setIsmovedIsSet(false);
    ismoved = false;
    originalfilename = null;
    setBlocksizeIsSet(false);
    blocksize = 0;
    setModetransferIsSet(false);
    modetransfer = 0;
    start = null;
    stop = null;
  }

  /**
   * @see RequestMode
   */
  public final RequestMode getMode() {
    return mode;
  }

  /**
   * @see RequestMode
   */
  public final R66Result setMode(final RequestMode mode) {
    this.mode = mode;
    return this;
  }

  public final void unsetMode() {
    mode = null;
  }

  /**
   * Returns true if field mode is set (has been assigned a value) and false
   * otherwise
   */
  public final boolean isSetMode() {
    return mode != null;
  }

  public final void setModeIsSet(final boolean value) {
    if (!value) {
      mode = null;
    }
  }

  public final String getFromuid() {
    return fromuid;
  }

  public final R66Result setFromuid(final String fromuid) {
    this.fromuid = fromuid;
    return this;
  }

  public final void unsetFromuid() {
    fromuid = null;
  }

  /**
   * Returns true if field fromuid is set (has been assigned a value) and
   * false
   * otherwise
   */
  public final boolean isSetFromuid() {
    return fromuid != null;
  }

  public final void setFromuidIsSet(final boolean value) {
    if (!value) {
      fromuid = null;
    }
  }

  public final String getDestuid() {
    return destuid;
  }

  public final R66Result setDestuid(final String destuid) {
    this.destuid = destuid;
    return this;
  }

  public final void unsetDestuid() {
    destuid = null;
  }

  /**
   * Returns true if field destuid is set (has been assigned a value) and
   * false
   * otherwise
   */
  public final boolean isSetDestuid() {
    return destuid != null;
  }

  public final void setDestuidIsSet(final boolean value) {
    if (!value) {
      destuid = null;
    }
  }

  public final String getFile() {
    return file;
  }

  public final R66Result setFile(final String file) {
    this.file = file;
    return this;
  }

  public final void unsetFile() {
    file = null;
  }

  /**
   * Returns true if field file is set (has been assigned a value) and false
   * otherwise
   */
  public final boolean isSetFile() {
    return file != null;
  }

  public final void setFileIsSet(final boolean value) {
    if (!value) {
      file = null;
    }
  }

  public final String getRule() {
    return rule;
  }

  public final R66Result setRule(final String rule) {
    this.rule = rule;
    return this;
  }

  public final void unsetRule() {
    rule = null;
  }

  /**
   * Returns true if field rule is set (has been assigned a value) and false
   * otherwise
   */
  public final boolean isSetRule() {
    return rule != null;
  }

  public final void setRuleIsSet(final boolean value) {
    if (!value) {
      rule = null;
    }
  }

  public final long getTid() {
    return tid;
  }

  public final R66Result setTid(final long tid) {
    this.tid = tid;
    setTidIsSet(true);
    return this;
  }

  public final void unsetTid() {
    issetBitfield = EncodingUtils.clearBit(issetBitfield, TID_ISSET_ID);
  }

  /**
   * Returns true if field tid is set (has been assigned a value) and false
   * otherwise
   */
  public final boolean isSetTid() {
    return EncodingUtils.testBit(issetBitfield, TID_ISSET_ID);
  }

  public final void setTidIsSet(final boolean value) {
    issetBitfield = EncodingUtils.setBit(issetBitfield, TID_ISSET_ID, value);
  }

  /**
   * @see Action
   */
  public final Action getAction() {
    return action;
  }

  /**
   * @see Action
   */
  public final R66Result setAction(final Action action) {
    this.action = action;
    return this;
  }

  public final void unsetAction() {
    action = null;
  }

  /**
   * Returns true if field action is set (has been assigned a value) and false
   * otherwise
   */
  public final boolean isSetAction() {
    return action != null;
  }

  public final void setActionIsSet(final boolean value) {
    if (!value) {
      action = null;
    }
  }

  /**
   * @see ErrorCode
   */
  public final ErrorCode getCode() {
    return code;
  }

  /**
   * @see ErrorCode
   */
  public final R66Result setCode(final ErrorCode code) {
    this.code = code;
    return this;
  }

  public final void unsetCode() {
    code = null;
  }

  /**
   * Returns true if field code is set (has been assigned a value) and false
   * otherwise
   */
  public final boolean isSetCode() {
    return code != null;
  }

  public final void setCodeIsSet(final boolean value) {
    if (!value) {
      code = null;
    }
  }

  public final String getResultinfo() {
    return resultinfo;
  }

  public final R66Result setResultinfo(final String resultinfo) {
    this.resultinfo = resultinfo;
    return this;
  }

  public final void unsetResultinfo() {
    resultinfo = null;
  }

  /**
   * Returns true if field resultinfo is set (has been assigned a value) and
   * false otherwise
   */
  public final boolean isSetResultinfo() {
    return resultinfo != null;
  }

  public final void setResultinfoIsSet(final boolean value) {
    if (!value) {
      resultinfo = null;
    }
  }

  public final int getGlobalstep() {
    return globalstep;
  }

  public final R66Result setGlobalstep(final int globalstep) {
    this.globalstep = globalstep;
    setGlobalstepIsSet(true);
    return this;
  }

  public final void unsetGlobalstep() {
    issetBitfield = EncodingUtils.clearBit(issetBitfield, GLOBALSTEP_ISSET_ID);
  }

  /**
   * Returns true if field globalstep is set (has been assigned a value) and
   * false otherwise
   */
  public final boolean isSetGlobalstep() {
    return EncodingUtils.testBit(issetBitfield, GLOBALSTEP_ISSET_ID);
  }

  public final void setGlobalstepIsSet(final boolean value) {
    issetBitfield =
        EncodingUtils.setBit(issetBitfield, GLOBALSTEP_ISSET_ID, value);
  }

  public final int getGloballaststep() {
    return globallaststep;
  }

  public final R66Result setGloballaststep(final int globallaststep) {
    this.globallaststep = globallaststep;
    setGloballaststepIsSet(true);
    return this;
  }

  public final void unsetGloballaststep() {
    issetBitfield =
        EncodingUtils.clearBit(issetBitfield, GLOBALLASTSTEP_ISSET_ID);
  }

  /**
   * Returns true if field globallaststep is set (has been assigned a value)
   * and
   * false otherwise
   */
  public final boolean isSetGloballaststep() {
    return EncodingUtils.testBit(issetBitfield, GLOBALLASTSTEP_ISSET_ID);
  }

  public final void setGloballaststepIsSet(final boolean value) {
    issetBitfield =
        EncodingUtils.setBit(issetBitfield, GLOBALLASTSTEP_ISSET_ID, value);
  }

  public final int getStep() {
    return step;
  }

  public final R66Result setStep(final int step) {
    this.step = step;
    setStepIsSet(true);
    return this;
  }

  public final void unsetStep() {
    issetBitfield = EncodingUtils.clearBit(issetBitfield, STEP_ISSET_ID);
  }

  /**
   * Returns true if field step is set (has been assigned a value) and false
   * otherwise
   */
  public final boolean isSetStep() {
    return EncodingUtils.testBit(issetBitfield, STEP_ISSET_ID);
  }

  public final void setStepIsSet(final boolean value) {
    issetBitfield = EncodingUtils.setBit(issetBitfield, STEP_ISSET_ID, value);
  }

  public final int getRank() {
    return rank;
  }

  public final R66Result setRank(final int rank) {
    this.rank = rank;
    setRankIsSet(true);
    return this;
  }

  public final void unsetRank() {
    issetBitfield = EncodingUtils.clearBit(issetBitfield, RANK_ISSET_ID);
  }

  /**
   * Returns true if field rank is set (has been assigned a value) and false
   * otherwise
   */
  public final boolean isSetRank() {
    return EncodingUtils.testBit(issetBitfield, RANK_ISSET_ID);
  }

  public final void setRankIsSet(final boolean value) {
    issetBitfield = EncodingUtils.setBit(issetBitfield, RANK_ISSET_ID, value);
  }

  public final boolean isRetrievemode() {
    return retrievemode;
  }

  public final R66Result setRetrievemode(final boolean retrievemode) {
    this.retrievemode = retrievemode;
    setRetrievemodeIsSet(true);
    return this;
  }

  public final void unsetRetrievemode() {
    issetBitfield =
        EncodingUtils.clearBit(issetBitfield, RETRIEVEMODE_ISSET_ID);
  }

  /**
   * Returns true if field retrievemode is set (has been assigned a value) and
   * false otherwise
   */
  public final boolean isSetRetrievemode() {
    return EncodingUtils.testBit(issetBitfield, RETRIEVEMODE_ISSET_ID);
  }

  public final void setRetrievemodeIsSet(final boolean value) {
    issetBitfield =
        EncodingUtils.setBit(issetBitfield, RETRIEVEMODE_ISSET_ID, value);
  }

  public final boolean isIsmoved() {
    return ismoved;
  }

  public final R66Result setIsmoved(final boolean ismoved) {
    this.ismoved = ismoved;
    setIsmovedIsSet(true);
    return this;
  }

  public final void unsetIsmoved() {
    issetBitfield = EncodingUtils.clearBit(issetBitfield, ISMOVED_ISSET_ID);
  }

  /**
   * Returns true if field ismoved is set (has been assigned a value) and
   * false
   * otherwise
   */
  public final boolean isSetIsmoved() {
    return EncodingUtils.testBit(issetBitfield, ISMOVED_ISSET_ID);
  }

  public final void setIsmovedIsSet(final boolean value) {
    issetBitfield =
        EncodingUtils.setBit(issetBitfield, ISMOVED_ISSET_ID, value);
  }

  public final String getOriginalfilename() {
    return originalfilename;
  }

  public final R66Result setOriginalfilename(final String originalfilename) {
    this.originalfilename = originalfilename;
    return this;
  }

  public final void unsetOriginalfilename() {
    originalfilename = null;
  }

  /**
   * Returns true if field originalfilename is set (has been assigned a value)
   * and false otherwise
   */
  public final boolean isSetOriginalfilename() {
    return originalfilename != null;
  }

  public final void setOriginalfilenameIsSet(final boolean value) {
    if (!value) {
      originalfilename = null;
    }
  }

  public final int getBlocksize() {
    return blocksize;
  }

  public final R66Result setBlocksize(final int blocksize) {
    this.blocksize = blocksize;
    setBlocksizeIsSet(true);
    return this;
  }

  public final void unsetBlocksize() {
    issetBitfield = EncodingUtils.clearBit(issetBitfield, BLOCKSIZE_ISSET_ID);
  }

  /**
   * Returns true if field blocksize is set (has been assigned a value) and
   * false otherwise
   */
  public final boolean isSetBlocksize() {
    return EncodingUtils.testBit(issetBitfield, BLOCKSIZE_ISSET_ID);
  }

  public final void setBlocksizeIsSet(final boolean value) {
    issetBitfield =
        EncodingUtils.setBit(issetBitfield, BLOCKSIZE_ISSET_ID, value);
  }

  public final int getModetransfer() {
    return modetransfer;
  }

  public final R66Result setModetransfer(final int modetransfer) {
    this.modetransfer = modetransfer;
    setModetransferIsSet(true);
    return this;
  }

  public final void unsetModetransfer() {
    issetBitfield =
        EncodingUtils.clearBit(issetBitfield, MODETRANSFER_ISSET_ID);
  }

  /**
   * Returns true if field modetransfer is set (has been assigned a value) and
   * false otherwise
   */
  public final boolean isSetModetransfer() {
    return EncodingUtils.testBit(issetBitfield, MODETRANSFER_ISSET_ID);
  }

  public final void setModetransferIsSet(final boolean value) {
    issetBitfield =
        EncodingUtils.setBit(issetBitfield, MODETRANSFER_ISSET_ID, value);
  }

  public final String getStart() {
    return start;
  }

  public final R66Result setStart(final String start) {
    this.start = start;
    return this;
  }

  public final void unsetStart() {
    start = null;
  }

  /**
   * Returns true if field start is set (has been assigned a value) and false
   * otherwise
   */
  public final boolean isSetStart() {
    return start != null;
  }

  public final void setStartIsSet(final boolean value) {
    if (!value) {
      start = null;
    }
  }

  public final String getStop() {
    return stop;
  }

  public final R66Result setStop(final String stop) {
    this.stop = stop;
    return this;
  }

  public final void unsetStop() {
    stop = null;
  }

  /**
   * Returns true if field stop is set (has been assigned a value) and false
   * otherwise
   */
  public final boolean isSetStop() {
    return stop != null;
  }

  public final void setStopIsSet(final boolean value) {
    if (!value) {
      stop = null;
    }
  }

  @Override
  public final void setFieldValue(final _Fields field, final Object value) {
    switch (field) {
      case MODE:
        if (value == null) {
          unsetMode();
        } else {
          setMode((RequestMode) value);
        }
        break;

      case FROMUID:
        if (value == null) {
          unsetFromuid();
        } else {
          setFromuid((String) value);
        }
        break;

      case DESTUID:
        if (value == null) {
          unsetDestuid();
        } else {
          setDestuid((String) value);
        }
        break;

      case FILE:
        if (value == null) {
          unsetFile();
        } else {
          setFile((String) value);
        }
        break;

      case RULE:
        if (value == null) {
          unsetRule();
        } else {
          setRule((String) value);
        }
        break;

      case TID:
        if (value == null) {
          unsetTid();
        } else {
          setTid((Long) value);
        }
        break;

      case ACTION:
        if (value == null) {
          unsetAction();
        } else {
          setAction((Action) value);
        }
        break;

      case CODE:
        if (value == null) {
          unsetCode();
        } else {
          setCode((ErrorCode) value);
        }
        break;

      case RESULTINFO:
        if (value == null) {
          unsetResultinfo();
        } else {
          setResultinfo((String) value);
        }
        break;

      case GLOBALSTEP:
        if (value == null) {
          unsetGlobalstep();
        } else {
          setGlobalstep((Integer) value);
        }
        break;

      case GLOBALLASTSTEP:
        if (value == null) {
          unsetGloballaststep();
        } else {
          setGloballaststep((Integer) value);
        }
        break;

      case STEP:
        if (value == null) {
          unsetStep();
        } else {
          setStep((Integer) value);
        }
        break;

      case RANK:
        if (value == null) {
          unsetRank();
        } else {
          setRank((Integer) value);
        }
        break;

      case RETRIEVEMODE:
        if (value == null) {
          unsetRetrievemode();
        } else {
          setRetrievemode((Boolean) value);
        }
        break;

      case ISMOVED:
        if (value == null) {
          unsetIsmoved();
        } else {
          setIsmoved((Boolean) value);
        }
        break;

      case ORIGINALFILENAME:
        if (value == null) {
          unsetOriginalfilename();
        } else {
          setOriginalfilename((String) value);
        }
        break;

      case BLOCKSIZE:
        if (value == null) {
          unsetBlocksize();
        } else {
          setBlocksize((Integer) value);
        }
        break;

      case MODETRANSFER:
        if (value == null) {
          unsetModetransfer();
        } else {
          setModetransfer((Integer) value);
        }
        break;

      case START:
        if (value == null) {
          unsetStart();
        } else {
          setStart((String) value);
        }
        break;

      case STOP:
        if (value == null) {
          unsetStop();
        } else {
          setStop((String) value);
        }
        break;

    }
  }

  @Override
  public final Object getFieldValue(final _Fields field) {
    switch (field) {
      case MODE:
        return getMode();

      case FROMUID:
        return getFromuid();

      case DESTUID:
        return getDestuid();

      case FILE:
        return getFile();

      case RULE:
        return getRule();

      case TID:
        return Long.valueOf(getTid());

      case ACTION:
        return getAction();

      case CODE:
        return getCode();

      case RESULTINFO:
        return getResultinfo();

      case GLOBALSTEP:
        return Integer.valueOf(getGlobalstep());

      case GLOBALLASTSTEP:
        return Integer.valueOf(getGloballaststep());

      case STEP:
        return Integer.valueOf(getStep());

      case RANK:
        return Integer.valueOf(getRank());

      case RETRIEVEMODE:
        return Boolean.valueOf(isRetrievemode());

      case ISMOVED:
        return Boolean.valueOf(isIsmoved());

      case ORIGINALFILENAME:
        return getOriginalfilename();

      case BLOCKSIZE:
        return Integer.valueOf(getBlocksize());

      case MODETRANSFER:
        return Integer.valueOf(getModetransfer());

      case START:
        return getStart();

      case STOP:
        return getStop();

    }
    throw new IllegalStateException();
  }

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

    switch (field) {
      case MODE:
        return isSetMode();
      case FROMUID:
        return isSetFromuid();
      case DESTUID:
        return isSetDestuid();
      case FILE:
        return isSetFile();
      case RULE:
        return isSetRule();
      case TID:
        return isSetTid();
      case ACTION:
        return isSetAction();
      case CODE:
        return isSetCode();
      case RESULTINFO:
        return isSetResultinfo();
      case GLOBALSTEP:
        return isSetGlobalstep();
      case GLOBALLASTSTEP:
        return isSetGloballaststep();
      case STEP:
        return isSetStep();
      case RANK:
        return isSetRank();
      case RETRIEVEMODE:
        return isSetRetrievemode();
      case ISMOVED:
        return isSetIsmoved();
      case ORIGINALFILENAME:
        return isSetOriginalfilename();
      case BLOCKSIZE:
        return isSetBlocksize();
      case MODETRANSFER:
        return isSetModetransfer();
      case START:
        return isSetStart();
      case STOP:
        return isSetStop();
    }
    throw new IllegalStateException();
  }

  @Override
  public final boolean equals(final Object that) {
    if (that == null) {
      return false;
    }
    if (that instanceof R66Result) {
      return equals((R66Result) that);
    }
    return false;
  }

  public final boolean equals(final R66Result that) {
    if (that == null) {
      return false;
    }

    final boolean this_present_mode = isSetMode();
    final boolean that_present_mode = that.isSetMode();
    if (this_present_mode || that_present_mode) {
      if (!(this_present_mode && that_present_mode)) {
        return false;
      }
      if (mode != that.mode) {
        return false;
      }
    }

    final boolean this_present_fromuid = isSetFromuid();
    final boolean that_present_fromuid = that.isSetFromuid();
    if (this_present_fromuid || that_present_fromuid) {
      if (!(this_present_fromuid && that_present_fromuid)) {
        return false;
      }
      if (!fromuid.equals(that.fromuid)) {
        return false;
      }
    }

    final boolean this_present_destuid = isSetDestuid();
    final boolean that_present_destuid = that.isSetDestuid();
    if (this_present_destuid || that_present_destuid) {
      if (!(this_present_destuid && that_present_destuid)) {
        return false;
      }
      if (!destuid.equals(that.destuid)) {
        return false;
      }
    }

    final boolean this_present_file = isSetFile();
    final boolean that_present_file = that.isSetFile();
    if (this_present_file || that_present_file) {
      if (!(this_present_file && that_present_file)) {
        return false;
      }
      if (!file.equals(that.file)) {
        return false;
      }
    }

    final boolean this_present_rule = isSetRule();
    final boolean that_present_rule = that.isSetRule();
    if (this_present_rule || that_present_rule) {
      if (!(this_present_rule && that_present_rule)) {
        return false;
      }
      if (!rule.equals(that.rule)) {
        return false;
      }
    }

    final boolean this_present_tid = isSetTid();
    final boolean that_present_tid = that.isSetTid();
    if (this_present_tid || that_present_tid) {
      if (!(this_present_tid && that_present_tid)) {
        return false;
      }
      if (tid != that.tid) {
        return false;
      }
    }

    final boolean this_present_action = isSetAction();
    final boolean that_present_action = that.isSetAction();
    if (this_present_action || that_present_action) {
      if (!(this_present_action && that_present_action)) {
        return false;
      }
      if (action != that.action) {
        return false;
      }
    }

    final boolean this_present_code = isSetCode();
    final boolean that_present_code = that.isSetCode();
    if (this_present_code || that_present_code) {
      if (!(this_present_code && that_present_code)) {
        return false;
      }
      if (code != that.code) {
        return false;
      }
    }

    final boolean this_present_resultinfo = isSetResultinfo();
    final boolean that_present_resultinfo = that.isSetResultinfo();
    if (this_present_resultinfo || that_present_resultinfo) {
      if (!(this_present_resultinfo && that_present_resultinfo)) {
        return false;
      }
      if (!resultinfo.equals(that.resultinfo)) {
        return false;
      }
    }

    final boolean this_present_globalstep = isSetGlobalstep();
    final boolean that_present_globalstep = that.isSetGlobalstep();
    if (this_present_globalstep || that_present_globalstep) {
      if (!(this_present_globalstep && that_present_globalstep)) {
        return false;
      }
      if (globalstep != that.globalstep) {
        return false;
      }
    }

    final boolean this_present_globallaststep = isSetGloballaststep();
    final boolean that_present_globallaststep = that.isSetGloballaststep();
    if (this_present_globallaststep || that_present_globallaststep) {
      if (!(this_present_globallaststep && that_present_globallaststep)) {
        return false;
      }
      if (globallaststep != that.globallaststep) {
        return false;
      }
    }

    final boolean this_present_step = isSetStep();
    final boolean that_present_step = that.isSetStep();
    if (this_present_step || that_present_step) {
      if (!(this_present_step && that_present_step)) {
        return false;
      }
      if (step != that.step) {
        return false;
      }
    }

    final boolean this_present_rank = isSetRank();
    final boolean that_present_rank = that.isSetRank();
    if (this_present_rank || that_present_rank) {
      if (!(this_present_rank && that_present_rank)) {
        return false;
      }
      if (rank != that.rank) {
        return false;
      }
    }

    final boolean this_present_retrievemode = isSetRetrievemode();
    final boolean that_present_retrievemode = that.isSetRetrievemode();
    if (this_present_retrievemode || that_present_retrievemode) {
      if (!(this_present_retrievemode && that_present_retrievemode)) {
        return false;
      }
      if (retrievemode != that.retrievemode) {
        return false;
      }
    }

    final boolean this_present_ismoved = isSetIsmoved();
    final boolean that_present_ismoved = that.isSetIsmoved();
    if (this_present_ismoved || that_present_ismoved) {
      if (!(this_present_ismoved && that_present_ismoved)) {
        return false;
      }
      if (ismoved != that.ismoved) {
        return false;
      }
    }

    final boolean this_present_originalfilename = isSetOriginalfilename();
    final boolean that_present_originalfilename = that.isSetOriginalfilename();
    if (this_present_originalfilename || that_present_originalfilename) {
      if (!(this_present_originalfilename && that_present_originalfilename)) {
        return false;
      }
      if (!originalfilename.equals(that.originalfilename)) {
        return false;
      }
    }

    final boolean this_present_blocksize = isSetBlocksize();
    final boolean that_present_blocksize = that.isSetBlocksize();
    if (this_present_blocksize || that_present_blocksize) {
      if (!(this_present_blocksize && that_present_blocksize)) {
        return false;
      }
      if (blocksize != that.blocksize) {
        return false;
      }
    }

    final boolean this_present_modetransfer = isSetModetransfer();
    final boolean that_present_modetransfer = that.isSetModetransfer();
    if (this_present_modetransfer || that_present_modetransfer) {
      if (!(this_present_modetransfer && that_present_modetransfer)) {
        return false;
      }
      if (modetransfer != that.modetransfer) {
        return false;
      }
    }

    final boolean this_present_start = isSetStart();
    final boolean that_present_start = that.isSetStart();
    if (this_present_start || that_present_start) {
      if (!(this_present_start && that_present_start)) {
        return false;
      }
      if (!start.equals(that.start)) {
        return false;
      }
    }

    final boolean this_present_stop = isSetStop();
    final boolean that_present_stop = that.isSetStop();
    if (this_present_stop || that_present_stop) {
      if (!(this_present_stop && that_present_stop)) {
        return false;
      }
      return stop.equals(that.stop);
    }

    return true;
  }

  @Override
  public final int hashCode() {
    return 0;
  }

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

    int lastComparison;

    lastComparison = Boolean.valueOf(isSetMode()).compareTo(other.isSetMode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMode()) {
      lastComparison = TBaseHelper.compareTo(mode, other.mode);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetFromuid()).compareTo(other.isSetFromuid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFromuid()) {
      lastComparison = TBaseHelper.compareTo(fromuid, other.fromuid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetDestuid()).compareTo(other.isSetDestuid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDestuid()) {
      lastComparison = TBaseHelper.compareTo(destuid, other.destuid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFile()).compareTo(other.isSetFile());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFile()) {
      lastComparison = TBaseHelper.compareTo(file, other.file);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRule()).compareTo(other.isSetRule());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRule()) {
      lastComparison = TBaseHelper.compareTo(rule, other.rule);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTid()).compareTo(other.isSetTid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTid()) {
      lastComparison = TBaseHelper.compareTo(tid, other.tid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetAction()).compareTo(other.isSetAction());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAction()) {
      lastComparison = TBaseHelper.compareTo(action, other.action);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCode()).compareTo(other.isSetCode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCode()) {
      lastComparison = TBaseHelper.compareTo(code, other.code);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetResultinfo()).compareTo(other.isSetResultinfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetResultinfo()) {
      lastComparison = TBaseHelper.compareTo(resultinfo, other.resultinfo);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetGlobalstep()).compareTo(other.isSetGlobalstep());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGlobalstep()) {
      lastComparison = TBaseHelper.compareTo(globalstep, other.globalstep);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetGloballaststep())
                            .compareTo(other.isSetGloballaststep());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGloballaststep()) {
      lastComparison =
          TBaseHelper.compareTo(globallaststep, other.globallaststep);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStep()).compareTo(other.isSetStep());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStep()) {
      lastComparison = TBaseHelper.compareTo(step, other.step);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRank()).compareTo(other.isSetRank());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRank()) {
      lastComparison = TBaseHelper.compareTo(rank, other.rank);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRetrievemode())
                            .compareTo(other.isSetRetrievemode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRetrievemode()) {
      lastComparison = TBaseHelper.compareTo(retrievemode, other.retrievemode);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetIsmoved()).compareTo(other.isSetIsmoved());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIsmoved()) {
      lastComparison = TBaseHelper.compareTo(ismoved, other.ismoved);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOriginalfilename())
                            .compareTo(other.isSetOriginalfilename());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOriginalfilename()) {
      lastComparison =
          TBaseHelper.compareTo(originalfilename, other.originalfilename);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetBlocksize()).compareTo(other.isSetBlocksize());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBlocksize()) {
      lastComparison = TBaseHelper.compareTo(blocksize, other.blocksize);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetModetransfer())
                            .compareTo(other.isSetModetransfer());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetModetransfer()) {
      lastComparison = TBaseHelper.compareTo(modetransfer, other.modetransfer);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetStart()).compareTo(other.isSetStart());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStart()) {
      lastComparison = TBaseHelper.compareTo(start, other.start);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStop()).compareTo(other.isSetStop());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStop()) {
      lastComparison = TBaseHelper.compareTo(stop, other.stop);
      return lastComparison;
    }
    return 0;
  }

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

  @Override
  public final void read(final TProtocol iprot) throws TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  @Override
  public final void write(final TProtocol oprot) throws TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public final String toString() {
    final StringBuilder sb = new StringBuilder("R66Result(");

    sb.append("mode:");
    if (mode == null) {
      sb.append("null");
    } else {
      sb.append(mode);
    }
    if (isSetFromuid()) {
      sb.append(", ");
      sb.append("fromuid:");
      if (fromuid == null) {
        sb.append("null");
      } else {
        sb.append(fromuid);
      }
    }
    if (isSetDestuid()) {
      sb.append(", ");
      sb.append("destuid:");
      if (destuid == null) {
        sb.append("null");
      } else {
        sb.append(destuid);
      }
    }
    if (isSetFile()) {
      sb.append(", ");
      sb.append("file:");
      if (file == null) {
        sb.append("null");
      } else {
        sb.append(file);
      }
    }
    if (isSetRule()) {
      sb.append(", ");
      sb.append("rule:");
      if (rule == null) {
        sb.append("null");
      } else {
        sb.append(rule);
      }
    }
    if (isSetTid()) {
      sb.append(", ");
      sb.append("tid:").append(tid);
    }
    if (isSetAction()) {
      sb.append(", ");
      sb.append("action:");
      if (action == null) {
        sb.append("null");
      } else {
        sb.append(action);
      }
    }
    sb.append(", ");
    sb.append("code:");
    if (code == null) {
      sb.append("null");
    } else {
      sb.append(code);
    }
    sb.append(", ");
    sb.append("resultinfo:");
    if (resultinfo == null) {
      sb.append("null");
    } else {
      sb.append(resultinfo);
    }
    if (isSetGlobalstep()) {
      sb.append(", ");
      sb.append("globalstep:").append(globalstep);
    }
    if (isSetGloballaststep()) {
      sb.append(", ");
      sb.append("globallaststep:").append(globallaststep);
    }
    if (isSetStep()) {
      sb.append(", ");
      sb.append("step:").append(step);
    }
    if (isSetRank()) {
      sb.append(", ");
      sb.append("rank:").append(rank);
    }
    if (isSetRetrievemode()) {
      sb.append(", ");
      sb.append("retrievemode:").append(retrievemode);
    }
    if (isSetIsmoved()) {
      sb.append(", ");
      sb.append("ismoved:").append(ismoved);
    }
    if (isSetOriginalfilename()) {
      sb.append(", ");
      sb.append("originalfilename:");
      if (originalfilename == null) {
        sb.append("null");
      } else {
        sb.append(originalfilename);
      }
    }
    if (isSetBlocksize()) {
      sb.append(", ");
      sb.append("blocksize:").append(blocksize);
    }
    if (isSetModetransfer()) {
      sb.append(", ");
      sb.append("modetransfer:").append(modetransfer);
    }
    if (isSetStart()) {
      sb.append(", ");
      sb.append("start:");
      if (start == null) {
        sb.append("null");
      } else {
        sb.append(start);
      }
    }
    if (isSetStop()) {
      sb.append(", ");
      sb.append("stop:");
      if (stop == null) {
        sb.append("null");
      } else {
        sb.append(stop);
      }
    }
    sb.append(')');
    return sb.toString();
  }

  public final void validate() throws TException {
    // check for required fields
    if (mode == null) {
      throw new TProtocolException(
          "Required field 'mode' was not present! Struct: " + this);
    }
    if (code == null) {
      throw new TProtocolException(
          "Required field 'code' was not present! Struct: " + this);
    }
    if (resultinfo == null) {
      throw new TProtocolException(
          "Required field 'resultinfo' was not present! Struct: " + this);
    }
    // check for sub-struct validity
  }

  private final void writeObject(final ObjectOutputStream out)
      throws IOException {
    try {
      write(new TCompactProtocol(new TIOStreamTransport(out)));
    } catch (final TException te) {
      throw new IOException(te);
    }
  }

  private final void readObject(final ObjectInputStream in)
      throws 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.
      issetBitfield = 0;
      read(new TCompactProtocol(new TIOStreamTransport(in)));
    } catch (final TException te) {
      throw new IOException(te);
    }
  }

  private static class R66ResultStandardSchemeFactory implements SchemeFactory {
    @Override
    public final R66ResultStandardScheme getScheme() {
      return new R66ResultStandardScheme();
    }
  }

  private static class R66ResultStandardScheme
      extends StandardScheme<R66Result> {

    @Override
    public final void read(final TProtocol iprot, final R66Result struct)
        throws TException {
      TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // MODE
            if (schemeField.type == TType.I32) {
              struct.mode = RequestMode.findByValue(iprot.readI32());
              struct.setModeIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // FROMUID
            if (schemeField.type == TType.STRING) {
              struct.fromuid = iprot.readString();
              struct.setFromuidIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // DESTUID
            if (schemeField.type == TType.STRING) {
              struct.destuid = iprot.readString();
              struct.setDestuidIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // FILE
            if (schemeField.type == TType.STRING) {
              struct.file = iprot.readString();
              struct.setFileIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // RULE
            if (schemeField.type == TType.STRING) {
              struct.rule = iprot.readString();
              struct.setRuleIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 20: // TID
            if (schemeField.type == TType.I64) {
              struct.tid = iprot.readI64();
              struct.setTidIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 21: // ACTION
            if (schemeField.type == TType.I32) {
              struct.action = Action.findByValue(iprot.readI32());
              struct.setActionIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 30: // CODE
            if (schemeField.type == TType.I32) {
              struct.code = ErrorCode.findByValue(iprot.readI32());
              struct.setCodeIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 31: // RESULTINFO
            if (schemeField.type == TType.STRING) {
              struct.resultinfo = iprot.readString();
              struct.setResultinfoIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 32: // GLOBALSTEP
            if (schemeField.type == TType.I32) {
              struct.globalstep = iprot.readI32();
              struct.setGlobalstepIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 33: // GLOBALLASTSTEP
            if (schemeField.type == TType.I32) {
              struct.globallaststep = iprot.readI32();
              struct.setGloballaststepIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 34: // STEP
            if (schemeField.type == TType.I32) {
              struct.step = iprot.readI32();
              struct.setStepIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 35: // RANK
            if (schemeField.type == TType.I32) {
              struct.rank = iprot.readI32();
              struct.setRankIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 36: // RETRIEVEMODE
            if (schemeField.type == TType.BOOL) {
              struct.retrievemode = iprot.readBool();
              struct.setRetrievemodeIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 37: // ISMOVED
            if (schemeField.type == TType.BOOL) {
              struct.ismoved = iprot.readBool();
              struct.setIsmovedIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 38: // ORIGINALFILENAME
            if (schemeField.type == TType.STRING) {
              struct.originalfilename = iprot.readString();
              struct.setOriginalfilenameIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 39: // BLOCKSIZE
            if (schemeField.type == TType.I32) {
              struct.blocksize = iprot.readI32();
              struct.setBlocksizeIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 40: // MODETRANSFER
            if (schemeField.type == TType.I32) {
              struct.modetransfer = iprot.readI32();
              struct.setModetransferIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 41: // START
            if (schemeField.type == TType.STRING) {
              struct.start = iprot.readString();
              struct.setStartIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 42: // STOP
            if (schemeField.type == TType.STRING) {
              struct.stop = iprot.readString();
              struct.setStopIsSet(true);
            } else {
              TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            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();
    }

    @Override
    public final void write(final TProtocol oprot, final R66Result struct)
        throws TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.mode != null) {
        oprot.writeFieldBegin(MODE_FIELD_DESC);
        oprot.writeI32(struct.mode.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.fromuid != null && struct.isSetFromuid()) {
        oprot.writeFieldBegin(FROMUID_FIELD_DESC);
        oprot.writeString(struct.fromuid);
        oprot.writeFieldEnd();
      }
      if (struct.destuid != null && struct.isSetDestuid()) {
        oprot.writeFieldBegin(DESTUID_FIELD_DESC);
        oprot.writeString(struct.destuid);
        oprot.writeFieldEnd();
      }
      if (struct.file != null && struct.isSetFile()) {
        oprot.writeFieldBegin(FILE_FIELD_DESC);
        oprot.writeString(struct.file);
        oprot.writeFieldEnd();
      }
      if (struct.rule != null && struct.isSetRule()) {
        oprot.writeFieldBegin(RULE_FIELD_DESC);
        oprot.writeString(struct.rule);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTid()) {
        oprot.writeFieldBegin(TID_FIELD_DESC);
        oprot.writeI64(struct.tid);
        oprot.writeFieldEnd();
      }
      if (struct.action != null && struct.isSetAction()) {
        oprot.writeFieldBegin(ACTION_FIELD_DESC);
        oprot.writeI32(struct.action.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.code != null) {
        oprot.writeFieldBegin(CODE_FIELD_DESC);
        oprot.writeI32(struct.code.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.resultinfo != null) {
        oprot.writeFieldBegin(RESULTINFO_FIELD_DESC);
        oprot.writeString(struct.resultinfo);
        oprot.writeFieldEnd();
      }
      if (struct.isSetGlobalstep()) {
        oprot.writeFieldBegin(GLOBALSTEP_FIELD_DESC);
        oprot.writeI32(struct.globalstep);
        oprot.writeFieldEnd();
      }
      if (struct.isSetGloballaststep()) {
        oprot.writeFieldBegin(GLOBALLASTSTEP_FIELD_DESC);
        oprot.writeI32(struct.globallaststep);
        oprot.writeFieldEnd();
      }
      if (struct.isSetStep()) {
        oprot.writeFieldBegin(STEP_FIELD_DESC);
        oprot.writeI32(struct.step);
        oprot.writeFieldEnd();
      }
      if (struct.isSetRank()) {
        oprot.writeFieldBegin(RANK_FIELD_DESC);
        oprot.writeI32(struct.rank);
        oprot.writeFieldEnd();
      }
      if (struct.isSetRetrievemode()) {
        oprot.writeFieldBegin(RETRIEVEMODE_FIELD_DESC);
        oprot.writeBool(struct.retrievemode);
        oprot.writeFieldEnd();
      }
      if (struct.isSetIsmoved()) {
        oprot.writeFieldBegin(ISMOVED_FIELD_DESC);
        oprot.writeBool(struct.ismoved);
        oprot.writeFieldEnd();
      }
      if (struct.originalfilename != null && struct.isSetOriginalfilename()) {
        oprot.writeFieldBegin(ORIGINALFILENAME_FIELD_DESC);
        oprot.writeString(struct.originalfilename);
        oprot.writeFieldEnd();
      }
      if (struct.isSetBlocksize()) {
        oprot.writeFieldBegin(BLOCKSIZE_FIELD_DESC);
        oprot.writeI32(struct.blocksize);
        oprot.writeFieldEnd();
      }
      if (struct.isSetModetransfer()) {
        oprot.writeFieldBegin(MODETRANSFER_FIELD_DESC);
        oprot.writeI32(struct.modetransfer);
        oprot.writeFieldEnd();
      }
      if (struct.start != null && struct.isSetStart()) {
        oprot.writeFieldBegin(START_FIELD_DESC);
        oprot.writeString(struct.start);
        oprot.writeFieldEnd();
      }
      if (struct.stop != null && struct.isSetStop()) {
        oprot.writeFieldBegin(STOP_FIELD_DESC);
        oprot.writeString(struct.stop);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class R66ResultTupleSchemeFactory implements SchemeFactory {
    @Override
    public final R66ResultTupleScheme getScheme() {
      return new R66ResultTupleScheme();
    }
  }

  private static class R66ResultTupleScheme extends TupleScheme<R66Result> {

    @Override
    public final void write(final TProtocol prot, final R66Result struct)
        throws TException {
      final TTupleProtocol oprot = (TTupleProtocol) prot;
      oprot.writeI32(struct.mode.getValue());
      oprot.writeI32(struct.code.getValue());
      oprot.writeString(struct.resultinfo);
      final BitSet optionals = new BitSet();
      if (struct.isSetFromuid()) {
        optionals.set(0);
      }
      if (struct.isSetDestuid()) {
        optionals.set(1);
      }
      if (struct.isSetFile()) {
        optionals.set(2);
      }
      if (struct.isSetRule()) {
        optionals.set(3);
      }
      if (struct.isSetTid()) {
        optionals.set(4);
      }
      if (struct.isSetAction()) {
        optionals.set(5);
      }
      if (struct.isSetGlobalstep()) {
        optionals.set(6);
      }
      if (struct.isSetGloballaststep()) {
        optionals.set(7);
      }
      if (struct.isSetStep()) {
        optionals.set(8);
      }
      if (struct.isSetRank()) {
        optionals.set(9);
      }
      if (struct.isSetRetrievemode()) {
        optionals.set(10);
      }
      if (struct.isSetIsmoved()) {
        optionals.set(11);
      }
      if (struct.isSetOriginalfilename()) {
        optionals.set(12);
      }
      if (struct.isSetBlocksize()) {
        optionals.set(13);
      }
      if (struct.isSetModetransfer()) {
        optionals.set(14);
      }
      if (struct.isSetStart()) {
        optionals.set(15);
      }
      if (struct.isSetStop()) {
        optionals.set(16);
      }
      oprot.writeBitSet(optionals, 17);
      if (struct.isSetFromuid()) {
        oprot.writeString(struct.fromuid);
      }
      if (struct.isSetDestuid()) {
        oprot.writeString(struct.destuid);
      }
      if (struct.isSetFile()) {
        oprot.writeString(struct.file);
      }
      if (struct.isSetRule()) {
        oprot.writeString(struct.rule);
      }
      if (struct.isSetTid()) {
        oprot.writeI64(struct.tid);
      }
      if (struct.isSetAction()) {
        oprot.writeI32(struct.action.getValue());
      }
      if (struct.isSetGlobalstep()) {
        oprot.writeI32(struct.globalstep);
      }
      if (struct.isSetGloballaststep()) {
        oprot.writeI32(struct.globallaststep);
      }
      if (struct.isSetStep()) {
        oprot.writeI32(struct.step);
      }
      if (struct.isSetRank()) {
        oprot.writeI32(struct.rank);
      }
      if (struct.isSetRetrievemode()) {
        oprot.writeBool(struct.retrievemode);
      }
      if (struct.isSetIsmoved()) {
        oprot.writeBool(struct.ismoved);
      }
      if (struct.isSetOriginalfilename()) {
        oprot.writeString(struct.originalfilename);
      }
      if (struct.isSetBlocksize()) {
        oprot.writeI32(struct.blocksize);
      }
      if (struct.isSetModetransfer()) {
        oprot.writeI32(struct.modetransfer);
      }
      if (struct.isSetStart()) {
        oprot.writeString(struct.start);
      }
      if (struct.isSetStop()) {
        oprot.writeString(struct.stop);
      }
    }

    @Override
    public final void read(final TProtocol prot, final R66Result struct)
        throws TException {
      final TTupleProtocol iprot = (TTupleProtocol) prot;
      struct.mode = RequestMode.findByValue(iprot.readI32());
      struct.setModeIsSet(true);
      struct.code = ErrorCode.findByValue(iprot.readI32());
      struct.setCodeIsSet(true);
      struct.resultinfo = iprot.readString();
      struct.setResultinfoIsSet(true);
      final BitSet incoming = iprot.readBitSet(17);
      if (incoming.get(0)) {
        struct.fromuid = iprot.readString();
        struct.setFromuidIsSet(true);
      }
      if (incoming.get(1)) {
        struct.destuid = iprot.readString();
        struct.setDestuidIsSet(true);
      }
      if (incoming.get(2)) {
        struct.file = iprot.readString();
        struct.setFileIsSet(true);
      }
      if (incoming.get(3)) {
        struct.rule = iprot.readString();
        struct.setRuleIsSet(true);
      }
      if (incoming.get(4)) {
        struct.tid = iprot.readI64();
        struct.setTidIsSet(true);
      }
      if (incoming.get(5)) {
        struct.action = Action.findByValue(iprot.readI32());
        struct.setActionIsSet(true);
      }
      if (incoming.get(6)) {
        struct.globalstep = iprot.readI32();
        struct.setGlobalstepIsSet(true);
      }
      if (incoming.get(7)) {
        struct.globallaststep = iprot.readI32();
        struct.setGloballaststepIsSet(true);
      }
      if (incoming.get(8)) {
        struct.step = iprot.readI32();
        struct.setStepIsSet(true);
      }
      if (incoming.get(9)) {
        struct.rank = iprot.readI32();
        struct.setRankIsSet(true);
      }
      if (incoming.get(10)) {
        struct.retrievemode = iprot.readBool();
        struct.setRetrievemodeIsSet(true);
      }
      if (incoming.get(11)) {
        struct.ismoved = iprot.readBool();
        struct.setIsmovedIsSet(true);
      }
      if (incoming.get(12)) {
        struct.originalfilename = iprot.readString();
        struct.setOriginalfilenameIsSet(true);
      }
      if (incoming.get(13)) {
        struct.blocksize = iprot.readI32();
        struct.setBlocksizeIsSet(true);
      }
      if (incoming.get(14)) {
        struct.modetransfer = iprot.readI32();
        struct.setModetransferIsSet(true);
      }
      if (incoming.get(15)) {
        struct.start = iprot.readString();
        struct.setStartIsSet(true);
      }
      if (incoming.get(16)) {
        struct.stop = iprot.readString();
        struct.setStopIsSet(true);
      }
    }
  }

}